-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot identified the prompts.js as a function?? #5692
Comments
Hey @MaybeSomeone 👋 Thanks for the error report! Can you do me a favor and provide some additional details for us?
Thanks! |
Hello i have provide the url, but i just init project by export web component use, and then i execute npm run generate. |
System: node 21.7.1 |
Thanks! I wasn't able to quite replicate it, but I think I know what's happening here. I see
|
Ok i'll try and i change for another macbook can replicate it. |
Hello how can i generate target component? it need me input the Component tag name, but export no relative components. |
I don't know how to choose the target component or export all exist components. |
You can generate a component with
and select any css/test files to be generated. I'm not sure I understand this part:
|
yes i have, but seems absolutely a new components different with that exist component.tsx file. |
Can you let me know how they differ? |
generate code
origin
|
That is the expected output for the |
this pr is motivated by a scneario where running `npx stencil generate` would result in either an error or an early return: ``` npm run generate > gen-test-1@0.0.1 generate > stencil generate [49:23.1] @stencil/core [49:23.2] v4.17.0 ♨️ ``` note: the reported error was never reproduced locally, only the early return. technically, this was introduced in v4.17.0, when we switched over to using esbuild for production builds. however, this has been present in any build that is esbuild-based since we migrated the cli submodule to esbuild (where we had a mixed rollup-esbuild build during the migration for dev builds). removing this alias eliminates dynamic imports in the CJS output of the cli submodule: ``` const { prompt: r } = await import('../sys/node/prompts.js') ``` which wouldn't run properly, causing the error/early return. this change does cause an increase in bundle size, as we end up importing more of prompts.js than we do. to mitigate this, we direct the cli module to the export we actually use (leading to less getting bundled in the cli module). fixes: #5692 STENCIL-1294 cannot identified the prompts.js as a function? ?
i want generate a WebComponent can be use in html directly. |
ok. i check the document i think i misunderstood........... |
Okay, I understand now. Thanks! Stencil's |
Yes. you are right!!! sincerely thanks!!!! |
this pr is motivated by a scneario where running `npx stencil generate` would result in either an error or an early return: ``` npm run generate > gen-test-1@0.0.1 generate > stencil generate [49:23.1] @stencil/core [49:23.2] v4.17.0 ♨️ ``` note: the reported error was never reproduced locally, only the early return. technically, this was introduced in v4.17.0, when we switched over to using esbuild for production builds. however, this has been present in any build that is esbuild-based since we migrated the cli submodule to esbuild (where we had a mixed rollup-esbuild build during the migration for dev builds). removing this alias eliminates dynamic imports in the CJS output of the cli submodule: ``` const { prompt: r } = await import('../sys/node/prompts.js') ``` which wouldn't run properly, causing the error/early return. this change does cause an increase in bundle size, as we end up importing more of prompts.js than we do. to mitigate this, we direct the cli module to the export we actually use (leading to less getting bundled in the cli module). fixes: #5692 STENCIL-1294 cannot identified the prompts.js as a function? ?
The fix for |
Prerequisites
Stencil Version
4.7.0
Current Behavior
when i execute npm generate then report a error!! uncaught cli error: TypeError: prompt is not a function, that's why????
Expected Behavior
i hope it can be run as normal
System Info
No response
Steps to Reproduce
just execute npm generate
Code Reproduction URL
https://github.com/MaybeSomeone/weathercomponent
Additional Information
No response
The text was updated successfully, but these errors were encountered: