Giter VIP home page Giter VIP logo

Comments (16)

Kwooda avatar Kwooda commented on June 20, 2024 1

We have a polyfill problem in our repos with v4.18.1. We have one repo for Stencil that generates the Web components, and another repo that consumes that repo to generate the React components. Any project that attempts to use the React components gets the following error:
export 'applyPolyfills' (imported as 'applyPolyfills') was not found in '@*******/loader' (possible exports: defineCustomElements, setNonce)

from stencil.

gavmck avatar gavmck commented on June 20, 2024 1

If I keep the same structure described in Stencil documentation to generate wrappers of Vue Components and React Components, we have a problem with Stencil 4.18.x to render these components

You can check my real code here

And I have a workaround to work with Vue3 too

In both cases I receive an error because applyPolyfills doesn't exist anymore

image Can you help us?

@felipefialho The answer for us was just to remove all mention of applyPolyfills

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

@gavmck thanks for raising the issue.

Unfortunately I was not able to verify that exploding build 😉 I created a new Stencil project, build it with v4.14.0 and then again with v4.18.1 and everything was fine:

❯ npm i
npm WARN deprecated [email protected]: < 22.5.0 is no longer supported

added 349 packages, and audited 350 packages in 6s

38 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
❯ npm run build

> [email protected] build
> stencil build

[18:02.0]  @stencil/core
[18:02.1]  v4.14.0 🚡
[18:02.8]  build, issue5780, prod mode, started ...
[18:02.8]  transpile started ...
[18:04.0]  transpile finished in 1.20 s
[18:04.0]  copy started ...
[18:04.0]  generate custom elements + source maps started ...
[18:04.0]  generate lazy + source maps started ...
[18:04.1]  copy finished (0 files) in 107 ms
[18:04.2]  generate custom elements + source maps finished in 213 ms
[18:04.3]  generate lazy + source maps finished in 299 ms
[18:04.3]  build finished in 1.55 s

❯ rm -r node_modules/ package-lock.json
❯ npm i
npm WARN deprecated [email protected]: < 22.5.0 is no longer supported

added 349 packages, and audited 350 packages in 2s

38 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
❯ npm run build

> [email protected] build
> stencil build

[18:22.1]  @stencil/core
[18:22.3]  v4.18.1 🏍
[18:22.8]  build, issue5780, prod mode, started ...
[18:22.9]  transpile started ...
[18:24.0]  transpile finished in 1.19 s
[18:24.0]  copy started ...
[18:24.1]  generate custom elements + source maps started ...
[18:24.1]  generate lazy + source maps started ...
[18:24.1]  copy finished (0 files) in 104 ms
[18:24.2]  generate custom elements + source maps finished in 159 ms
[18:24.4]  generate lazy + source maps finished in 287 ms
[18:24.4]  build finished in 1.53 s

Can you provide a step by step description on how to reproduce the problem please?

from stencil.

ionitron-bot avatar ionitron-bot commented on June 20, 2024

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

from stencil.

gavmck avatar gavmck commented on June 20, 2024

@gavmck thanks for raising the issue.

Unfortunately I was not able to verify that exploding build 😉 I created a new Stencil project, build it with v4.14.0 and then again with v4.18.1 and everything was fine:

❯ npm i
npm WARN deprecated [email protected]: < 22.5.0 is no longer supported

added 349 packages, and audited 350 packages in 6s

38 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
❯ npm run build

> [email protected] build
> stencil build

[18:02.0]  @stencil/core
[18:02.1]  v4.14.0 🚡
[18:02.8]  build, issue5780, prod mode, started ...
[18:02.8]  transpile started ...
[18:04.0]  transpile finished in 1.20 s
[18:04.0]  copy started ...
[18:04.0]  generate custom elements + source maps started ...
[18:04.0]  generate lazy + source maps started ...
[18:04.1]  copy finished (0 files) in 107 ms
[18:04.2]  generate custom elements + source maps finished in 213 ms
[18:04.3]  generate lazy + source maps finished in 299 ms
[18:04.3]  build finished in 1.55 s

❯ rm -r node_modules/ package-lock.json
❯ npm i
npm WARN deprecated [email protected]: < 22.5.0 is no longer supported

added 349 packages, and audited 350 packages in 2s

38 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
❯ npm run build

> [email protected] build
> stencil build

[18:22.1]  @stencil/core
[18:22.3]  v4.18.1 🏍
[18:22.8]  build, issue5780, prod mode, started ...
[18:22.9]  transpile started ...
[18:24.0]  transpile finished in 1.19 s
[18:24.0]  copy started ...
[18:24.1]  generate custom elements + source maps started ...
[18:24.1]  generate lazy + source maps started ...
[18:24.1]  copy finished (0 files) in 104 ms
[18:24.2]  generate custom elements + source maps finished in 159 ms
[18:24.4]  generate lazy + source maps finished in 287 ms
[18:24.4]  build finished in 1.53 s

Can you provide a step by step description on how to reproduce the problem please?

@christian-bromann Ah sorry, it's not the build that explodes, it's the install. The previous instructions said to do this.

import { applyPolyfills, defineCustomElements } from 'my-component-library';

applyPolyfills().then(() => {
  defineCustomElements();
});

Now the applyPolyfills function does not exist unless you build for es5 so previous working installs break.

from stencil.

gavmck avatar gavmck commented on June 20, 2024

The type also seems to output that the function exists still

const generateIndexDts = (indexDtsPath: string, componentsDtsPath: string) => {

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

How do you set applyPolyfills ? Can you please provide a reproducible example? It is unknown to me what my-component-library exports here.

from stencil.

gavmck avatar gavmck commented on June 20, 2024

I'll see if I can know one up. applyPolyfills came from the stencil loader

It looks like it was removed from the docs last year and I missed it.

ionic-team/stencil-site@3a910c2#diff-f1f96788acd155196970469f3c5031d518d3800fde982f92412858072a726bcfL518

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

That is correct. This has been done due to the fact that Stencil stopped supporting IE, afaik. Do you think we can close this issue then?

from stencil.

gavmck avatar gavmck commented on June 20, 2024

Do we still need to update the type?

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

Yes, let me raise a PR for that.

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

Actually we have this planned to remove for Stencil v5.

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

@Kwooda thanks for the feedback, is there a chance you can provide a minimal reproducible example?

from stencil.

Kwooda avatar Kwooda commented on June 20, 2024

I don't know - last time I tried I got slapped by our security team, but I'll see if there's anything I can do.

from stencil.

christian-bromann avatar christian-bromann commented on June 20, 2024

Ideally from a new Stencil project, e.g. that you can create via npm init stencil.

from stencil.

felipefialho avatar felipefialho commented on June 20, 2024

If I keep the same structure described in Stencil documentation to generate wrappers of Vue Components and React Components, we have a problem with Stencil 4.18.x to render these components

You can check my real code here

And I have a workaround to work with Vue3 too

In both cases I receive an error because applyPolyfills doesn't exist anymore

image

Can you help us?

from stencil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.