-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Problem importing javascript files inside node_modules package folder #3840
Comments
Try this: |
thanks for your reply! i'd tried this, |
i found a temporary solution, i replace // vite.config.js
export default defineConfig({
resolve: {
alias: [
{find: /^cesium\//, replacement: '/node_modules/cesium/'}
]
},
plugins: [vue()]
}) hoping vite may resolve this kind of problems |
I think it's an upstream issue. Tracked at CesiumGS/cesium#9212 |
This issue has been locked since it has been closed for more than 14 days. If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion. |
Describe the bug
I'm trying to migrate a cesium project from webpack to vitejs.
But error raised when i tried to directly import files inside the package folder. (which worked under webpack)
however, everything worked fine if i replaced the import statement to
'/node_modules/cesium/Source/Core/Cartesian3'
,while Vetur keep alerting me that
Cannot find module '/node_modules/cesium/Source/Core/Cartesian3' or its corresponding type declarations.
i wanna a solution to fix this problem
Reproduction
cesium
packagecesium
Source code in vitejs entry fileand then the error may reported
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager:
Logs
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: