-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Could not load node_modules/tslib/tslib.es6.js/tslib.es6.js when using @nuxt/apollo & @vueuse/motion/nuxt together #19265
Comments
I found a workaround for now, when I comment out the line
It seems like '@vueuse/motion' is creating an alias and '@nuxtjs/apollo' is trying to add the file name again after that. This results in the file not being found due to the incorrect location: 'node_modules/tslib/tslib.es6.js/tslib.es6.js'. |
Would you raise an issue in https://github.com/vueuse/motion? 🙏 I don't think this is a Nuxt framework issue. |
I'm having this same issue, except it doesn't happen until I run the dist server and try a request and the tslib config hack does not work for me:
|
For the record, I just had the same issue as @ssyberg, fixed by aliasing |
That didn't work for me, the only thing that worked was simply downgrading to tslib 2.5.1 |
I recommend using solution with transpile mentioned below #19265 (comment) My problem is somehow related to this. And my workaround is different because I get the error at runtime. Had to patch tslib exports after build by adding the Also pinned the {
"scripts": {
"build": "nuxt build",
"// postbuild": "https://github.com/nuxt/nuxt/issues/19265",
"postbuild": "cd .output/server/node_modules/tslib; npm pkg set 'exports[.].import.node'='./tslib.es6.mjs'"
}
} |
I'm getting tslib import error in runtime as well, but only for a specific page.
Nuxt 3.6.3 and 3.6.5 both have this issue. Not sure which version introduced this issue; I will have to look into previous builds to find out. The error happens on our Node server and Vercel, but Cloudflare Pages works fine. |
In my project (Nuxt ^3.7.0 just add vueuse), all I need to do is add the following content to the build: {
transpile: ['tslib']
} Similarly, the above solution is equally effective:
|
@liunnn1994 多谢念大佬,我解决了,本地运行没问题,在vercel上就有问题nuxt.config.ts上配置上就ok了 |
Had the same issue in my project (Nuxt 3.7.1 with modules vueuse and apollo). That's worked for me. Thank you @iamandrewluca, @liunnn1994
|
had the issue after upgrading to 3.9.0 |
Closes WorldWideTelescope#73. As per nuxt/nuxt#19265, this seems to fix the production server.
Environment
Darwin
v16.17.1
3.2.2
2.2.3
yarn@1.22.19
vite
runtimeConfig
,modules
,apollo
@nuxtjs/apollo@5.0.0-alpha.5
,@vueuse/motion/nuxt@2.0.0-beta.27
-
Reproduction
Init project
npx nuxi init <project-name> && cd <project-name>
Install Nuxt Apollo & Vueuse Motion
yarn add -D @nuxtjs/apollo@next
yarn add @vueuse/motion@2.0.0-beta.27
Setup minimal configuration in nuxt.config.ts:
Build
yarn build
Describe the bug
The following log is the result of running
yarn build
with the aforementioned setup. It seems like its trying to look for the 'tslib.es6.js' file in the '/tslib.es6.js/' folder. This file and folder do not exist, however the 'tslib.es6.js' file does exist in the root of the tslib package. This error only appears when both the Motion and Apollo modules are defined in the nuxt.config.ts, when just either one is defined there's is no issue and it builds as expected.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: