-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 'rollup/parseAst' or its corresponding type declarations. #5199
Comments
Unfortunately, this only works if you set |
See microsoft/TypeScript#50058 Do you have a workaround? |
One workaround, Setting |
I am still experiencing this issue. Why has it been closed? |
When line-bot-sdk-nodejs supports ESM, we will use ESM code for testing. Vitest supports ESM+Typescript. This change will switch from using mocha to using vitest. Also, along with mocha, nyc will be removed from dependencies because vitest supports coverage as well. About the workaround: 1. Running vitest 1.4.0 results in TypeScript errors due to an issue with vite, which vitest uses. The latest version of vite has fixed this, so I explicitly added the latest vite to the dev dependencies. - vitejs/vite#15714 2. Running vite for CJS leads to TypeScript errors due to an issue with rollup, which vite uses. There is no good workaround for CJS. I resolved this by rewriting node_modules as a workaround. There are no problems using vitest(?) * rollup/rollup#5199 * vitest-dev/vitest#4567
me too still experiencing this issue. |
Also still experiencing this issue. |
Because everything is working as intended and setting |
Note that this is breaking for anyone having a TS project with ES modules using My workaround now is to add a custom mapping in my "paths": {
// workaround for: https://github.com/vitest-dev/vitest/issues/4567
"rollup/parseAst": ["./node_modules/rollup/dist/parseAst"]
} I am not an export in module systems in the JavaScript ecosystem. Should I report this with Vitest? |
Never mind, adding |
|
I ran into this issue while using vitest. I got the rollup error because vitest was using vite, so I couldn't change the import. My problem was caused by |
As suggested by @jordi-studyportals, I removed |
first set "module" : "ES2015" then "moduleResolution" : "Bundler" in tsconfig.json file. It'll fix the issue, atleast fixed for me. |
Not every project can do those chances. The wrong here is the library. |
The problem is, that it doesn't.
tried this too to no avail. The other solutions were for For me the issue still exists and seems there is no working solution to that - at least I haven't found one. |
moduleResolution: "bundler" does NOT address this issue for Vite. |
If you are using {
"compilerOptions": {
"paths": {
// workaround for: https://github.com/vitest-dev/vitest/issues/4567
// notice that we'll need to update this when newer versions of vitest are used
"rollup/parseAst": ["node_modules/.pnpm/rollup@4.21.1/node_modules/rollup/dist/parseAst"]
}
},
} |
Rollup Version
v4.0.2
Operating System (or Browser)
Chrome
Node Version (if applicable)
No response
Link To Reproduction
https://stackblitz.com/edit/parseast-error?file=src%2Fmain.ts,tsconfig.json
Expected Behaviour
Importing from
'rollup/parseAst'
should not throw error.Actual Behaviour
Importing from
'rollup/parseAst'
throws the following error:The text was updated successfully, but these errors were encountered: