Closed douwepausma closed 9 months ago
I'm encountering the same problem at the moment!
Ran into the same issue, the alias workaround fixed the issue for me. Not an idea solution ofc but it works
Same on my end, but I had to alias tslib
to tslib/tslib.es6.js
to workaround it.
I'm unable to reproduce this issue by following your reproduction steps using the latest release so I think this issue has been resolved and can be closed.
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
I found a workaround for now, when I comment out the line
nuxt.options.alias.tslib = "tslib/tslib.es6.js";
in _nodemodules/@vueuse/motion/dist/nuxt.cjs & _nodemodules/@vueuse/motion/dist/nuxt.mjs it will built correctly. However this not a particularly durable solution, so looking a little further I figured out that adding the following to the nuxt.config.ts does the trick as well.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: _'nodemodules/tslib/tslib.es6.js/tslib.es6.js'.