-
Notifications
You must be signed in to change notification settings - Fork 766
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 find module 'puppeteer'. #2471
Comments
Was seeing this in 1.12.2 as well. Upgrading to @stencil/core 1.14.0 fixed it for me. |
I think I've had the same problem for ages: after This is especially noticeable because of a bug in I just updated to 1.14.0 and haven't been able to reproduce it yet. IMHO @Grand-Poobah If you run |
I had the same experience with Stencil 2.0.3 just now: npm init stencil
# Starter == "app"
# Project name == "test"
cd test
npm i
npm start At this point making a valid change to JSX in a render method, such as the app-home.tsx file generated by export class AppHome {
render() {
return (
<div class="app-home">
<p>
Welcome to the Stencil App Starter. You can use this starter to build entire apps all with web components using Stencil! Check out our docs on{' '}
<a href="https://stenciljs.com">stenciljs.com</a> to get started.
</p>
{/* Add empty div */}
<div></div>
<stencil-route-link url="/profile/stencil">
<button>Profile page</button>
</stencil-route-link>
<stencil-route-link url="/profile/stencil">
<button>Profile page</button>
</stencil-route-link>
</div>
);
}
########################################
# Test one (ERR!)
########################################
$ npm test
> test@0.0.1 test /home/me/src/test
> stencil test --spec --e2e
[15:52.7] @stencil/core
[15:52.9] v2.0.3 🍮
[ ERROR ] Please install missing dev dependencies with either npm or yarn.
npm install --save-dev @types/jest@26.0.12 jest@26.4.2 jest-cli@26.4.2 @types/puppeteer@3.0.1
puppeteer@5.2.1
npm ERR! Test failed. See above for more details.
########################################
# Follow instructions
########################################
$ npm install --save-dev @types/jest@26.0.12 jest@26.4.2 jest-cli@26.4.2 @types/puppeteer@3.0.1
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.2 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ jest@26.4.2
+ jest-cli@26.4.2
+ @types/puppeteer@3.0.1
+ @types/jest@26.0.12
added 615 packages from 372 contributors and audited 620 packages in 13.001s
21 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
########################################
# Test two (ERR!)
########################################
$ npm test
> test@0.0.1 test /home/me/src/test
> stencil test --spec --e2e
[16:22.3] @stencil/core
[16:22.5] v2.0.3 🍮
[ ERROR ] Please install missing dev dependencies with either npm or yarn.
npm install --save-dev puppeteer@5.2.1
npm ERR! Test failed. See above for more details.
########################################
# Follow instructions again
########################################
$ npm install --save-dev puppeteer@5.2.1
> puppeteer@5.2.1 install /home/me/src/test/node_modules/puppeteer
> node install.js
Downloading Chromium r782078 - 126.4 Mb [====================] 100% 0.0s
Chromium (782078) downloaded to /home/me/src/test/node_modules/puppeteer/.local-chromium/linux-782078
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ puppeteer@5.2.1
added 29 packages from 26 contributors and audited 649 packages in 7.933s
22 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
########################################
# Test three (PASS)
########################################
$ npm test
> test@0.0.1 test /home/me/src/test
> stencil test --spec --e2e
[16:46.6] @stencil/core
[16:46.8] v2.0.3 🍮
[16:46.9] testing e2e and spec files
[16:48.4] build, app, dev mode, started ...
[16:48.4] transpile started ...
[16:50.4] transpile finished in 1.91 s
[16:50.4] copy started ...
[16:50.4] generate lazy started ...
[16:50.5] copy finished (3 files) in 186 ms
[16:51.1] generate lazy finished in 691 ms
[16:51.1] build finished in 2.71 s
[16:51.1] jest args: --e2e --spec --max-workers=8
PASS src/components/app-profile/app-profile.spec.ts
PASS src/components/app-home/app-home.e2e.ts
PASS src/components/app-profile/app-profile.e2e.ts
PASS src/components/app-root/app-root.e2e.ts
Test Suites: 4 passed, 4 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 1.896 s
Ran all test suites.
$ Now updating JSX works as expected while the I think it seems logical that these dependencies should be present upon $ npm run generate my-component
> test@0.0.1 generate /home/me/src/test
> stencil generate "my-component"
[40:01.1] @stencil/core
[40:01.2] v2.0.3 🍮
? Which additional files do you want to generate? ›
Instructions:
↑/↓: Highlight option
←/→/[space]: Toggle selection
a: Toggle all
enter/return: Complete answer
◉ Stylesheet (.css)
◉ Spec Test (.spec.tsx)
◉ E2E Test (.e2e.ts) |
Install dependencies for test. npm install --save-dev @types/jest jest-cli jest @types/puppeteer puppeteer |
I tried to change the version of stencil. It didn't work. The only way I made it work was by stopping the project and doing "npm start" again. In my case, I have to add that this bug only appeared when I created a new folder in src/components. |
Had this same issue with @stencil/core 2.4.0. Installing dependencies for test helped temporarily as @pandevim suggested. Generating a new component with
|
I think it might be related with Puppeteer 7.0.1 and higher having the type definitions shipped with the package: https://github.com/puppeteer/puppeteer#usage-with-typescript. I had both Puppeteer (7.1.0) and I then took a look at the DefinitelyTyped repository and searched for Given all this, I think the Stencil team is still importing the Puppeteer types from the DefinitelyType repo, even though that's not necessary if you use Puppeteer 7.0.1 and higher. Workaround npm i -D puppeteer@6 @types/puppeteer |
Is there any update on that issue? Still having the problem @lodybo describes above with Update: also with |
As @lodybo has described, the error lies in the usage of old puppeteer versions inside For example the The only way to fix this is a PR with upgraded puppeteer versions. I could give it a try but I'm not sure if this open Pandoras Box ;) Are there any reasons not to update the version? |
I believe that this issue is resolved following the v2.7.0 release. As of v2.7.0, Stencil supports Puppeteer v10 - folks running into this issue should update Puppeteer to v10, Stencil to v2.7.0, and uninstall |
Stencil version:
-- @stencil/core@1.12.2
I'm submitting a:
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
When the project is running (npm start) making a change causes the error. Rebuilding the code and rerunning does not show cause the error.
Expected behavior:
Component should refresh without error.
Steps to reproduce:
change this
return <div>Hello, World! I'm {this.getText()}</div>;
to this
Related code:
This is the terminal output
Other information:
I have tried installing puppeteer
breaking npm start and rerunning it does not cause the error to occur
Removing the tests stops the issue
The text was updated successfully, but these errors were encountered: