Closed sarvex closed 1 year ago
Yo, from what I can tell Vite is not able to find the module @unpic/core in your project, could you confirm it is in fact installed. Once you have done that you need to add it to the build.rollupOptions.external array. This will tell Vite to not try to bundle the module with your application.
Open your vite.config.js file and add the following line to the build.rollupOptions object: external: ['@unpic/core']
@spectraisdeadaf I have tried all these things and nothing worked.
Now this happens only when vercel edge
integration is added.
Thats weird, have you used the --save flag when installing @unpic/core. (npm install --save @unpic/core) Maybe it was not added to your project's package.json file and does not get installed with your build script.
@spectraisdeadaf the dependency is saved alright in the package.json
. The whole thing works fine in the local environment till I add the vercel edge
integration to the project.
oh okay, could you share a snippet of the code in the file it is throwing the error for?
@spectraisdeadaf apologies I did not mention the steps of reproduction earlier.
pnpm build
works fine without a glitchvercel edge
as a dependency using pnpm qwik add
pnpm build
fails with the error mentioned earlier. Hey so I cloned the site and managed reproducing the error. I fixed it by adding the following to vite config (None Existent Path would be D:/Source/qwind-starter/src/s_w1wzaavnrf0.js for you )
build: {
rollupOptions: {
external: '<None Existent Path>'
}
},
Yeah @spectraisdeadaf but this suppresses the error, not fix it.
Hello @sarvex
This template is intended to be generated static. The "@vercel/edge" dependency is not needed.