Skip to content
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

Nuxt build fails with 2.3.0 release #28

Closed
elrolito opened this issue Feb 21, 2018 · 6 comments
Closed

Nuxt build fails with 2.3.0 release #28

elrolito opened this issue Feb 21, 2018 · 6 comments
Labels

Comments

@elrolito
Copy link

elrolito commented Feb 21, 2018

Trying to update to latest release causes nuxt build to fail on missing dependencies, but version 2.2.4 does not have this issue. Also seems like the build is much slower.

This bug report is available on Nuxt.js community (#c22)
@paulgv
Copy link
Collaborator

paulgv commented Feb 21, 2018

Hi @elrolito,
Is there an error message about those missing dependencies?
Have you tried removing your node_modules/ and reinstalling them fresh?
Also, how did you configure the module?
Thanks!

@FransTwisk
Copy link

FransTwisk commented Feb 21, 2018

Same here:

 ERROR  Failed to compile with 128 errors                                                                              9:32:49 AM

These dependencies were not found:

* aws-sdk in ./node_modules/fsevents/node_modules/node-pre-gyp/lib/unpublish.js, ./node_modules/fsevents/node_modules/node-pre-gyp/lib/publish.js and 1 other
* child_process in ./node_modules/fsevents/node_modules/detect-libc/lib/detect-libc.js, ./node_modules/fsevents/node_modules/node-pre-gyp/lib/testbinary.js and 12 others
* fs in ./server.js, ./node_modules/@nuxtjs/youch/src/Youch/index.js and 94 others
* module in ./node_modules/nuxt/lib/core/nuxt.js, ./node_modules/vue-server-renderer/build.js and 1 other
* net in ./node_modules/express/lib/request.js, ./node_modules/forever-agent/index.js and 5 others
* readline in ./node_modules/friendly-errors-webpack-plugin/src/output.js
* tls in ./node_modules/forever-agent/index.js, ./node_modules/fsevents/node_modules/forever-agent/index.js and 2 others

To install them, you can run: npm install --save aws-sdk child_process fs module net readline tls

Happens even after removing node_modules and fresh install.

config:

const en = require('../locales/en-US.js')
const nl = require('../locales/nl-NL.js')

const I18N = {
  locales: [
    {
      code: 'en',
      iso: 'en-US',
      name: 'English'
    },
    {
      code: 'nl',
      iso: 'nl-NL',
      name: 'Nederlands'
    }
  ],
  routes: {},
  defaultLocale: 'en',
  noPrefixDefaultLocale: true,
  loadLanguagesAsync: false,
  vueI18n: {
    fallbackLocale: 'en',
    messages: { en, nl }
  }
}

module.exports = {
  I18N
}

@RomainLK
Copy link

RomainLK commented Feb 21, 2018

I'm also having issues building both in nuxt dev and nuxt build ( nuxt build even kills the encoding of my terminal )

 ERROR  Failed to compile with 9 errors                                                                                                 10:43:47

These dependencies were not found:

* fs in ./node_modules/fs.realpath/index.js, ./node_modules/fs.realpath/old.js and 6 others
* module in ./node_modules/vue-server-renderer/build.js

To install them, you can run: npm install --save fs module

Tried to run the npm command unconvinced that it would solve anything. The error message just changed:

 ERROR  Failed to compile with 16 errors                                                                                                10:51:11

This dependency was not found:

* fs in ./node_modules/clone-stats/index.js, ./node_modules/convert-source-map/index.js and 14 others

To install it, you can run: npm install --save fs

Both seo and lazyLoading were set to false in config. And this is from a fresh node_modules without package-lock. Rollbacking to 2.2.4 does fix...

@RomainLK
Copy link

RomainLK commented Feb 21, 2018

Locked down the culprit: the async import in i18n.utils.js. No build error when removed.

edit: Ok, found a fix. You need to define a valid langDir( empty folder does the job ). While loadLanguagesAsync is disabled, thei18n.utils.js is still loaded. This mean that webpack will still try to statically build the asynchronous bundle but without langDir it will fail.

@paulgv paulgv closed this as completed in 7ce1f11 Feb 21, 2018
@paulgv
Copy link
Collaborator

paulgv commented Feb 21, 2018

Thanks for the help guys, should be fixed in 2.3.2.
The issue will still occur when setting langDir to an empty string though (or pretty much any path matching root dir), this dynamic import error is a mystery to me, I'll need to give it a closer look and come up with a better fix.

@Hexodus
Copy link

Hexodus commented Mar 20, 2018

I had recently a similar error because of:
module.exports = { I18N }
I changed it to:
module.exports = I18N
And it works ;)

kazupon pushed a commit that referenced this issue Dec 21, 2023
* refactor: integrate `localizeRoutes` from `vue-i18n-routing`

* test: integrate `localizeRoutes` tests

* refactor: integrate localizeRoutes from vue-i18n-routing (#28)
DarthGigi pushed a commit to DarthGigi/i18n that referenced this issue Apr 16, 2024
…dules#2625)

* refactor: integrate `localizeRoutes` from `vue-i18n-routing`

* test: integrate `localizeRoutes` tests

* refactor: integrate localizeRoutes from vue-i18n-routing (nuxt-modules#28)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants