🐛 The bug
When deploying out a nuxt site on Netlify using nuxt generate causes an error.
🛠️ To reproduce
Steps to reproduce the behavior:
Nuxt generate works fine locally but fails on Netlify builds, could be more a Netlify issue? But wanted to try here first.
yarn generate
yarn run v1.22.10
$ nuxt generate
[fatal] Package subpath './dist/vue-composition-api.esm.js' is not defined by "exports" in /opt/build/repo/node_modules/@vue/composition-api/package.json
at applyExports (internal/modules/cjs/loader.js:491:9)
at resolveExports (internal/modules/cjs/loader.js:507:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:635:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
at Function.resolve (internal/modules/cjs/helpers.js:78:19)
at Function.m [as resolve] (node_modules/jiti/dist/jiti.js:1:52919)
at Resolver.resolveModule (node_modules/@nuxt/core/dist/core.js:263:28)
at ModuleContainer.compositionApiModule2 (node_modules/@nuxtjs/composition-api/dist/module/index.js:147:22)
at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:239:34)
at node_modules/@nuxt/utils/dist/utils.js:639:43
🌈 Expected behaviour
Netlify builds out correctly using plugin.
The version of Node used by default on Netlify (v12.18.0) does not support subpath exports with patterns (used in @vue/composition-api).
To work around this, you can set the Netlify NODE_VERSION environment variable to 12 or 14, which will enable the latest version of each of those LTS releases.
cc: @ascorbic
The version of Node used by default on Netlify (v12.18.0) does not support subpath exports with patterns (used in
@vue/composition-api).To work around this, you can set the Netlify
NODE_VERSIONenvironment variable to12or14, which will enable the latest version of each of those LTS releases.cc: @ascorbic
That sorted it, thanks!
Most helpful comment
That sorted it, thanks!