question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuxt.js projects fail to compile

See original GitHub issue

Bug report

All Nuxt.js projects fail to compile (probably due to a dependency update?)

Describe the bug

Nuxt.js projects compile with 5 errors from core-js and chokidar. Tested from multiple machines running on different node versions

To Reproduce

  1. create a new Nuxt project through create-keystone-app
  2. run the default yarn dev server
  3. app compiles with errors. see console log below

Console log

i Command: keystone dev
√ Validated project entry file ./index.js
√ Keystone server listening on port 3000
√ Initialised Keystone instance
- Connecting to databasei Preparing project for development
              18:38:54
i Initial build may take a while                                                          18:38:54
\ Connecting to database√ Builder initialized
              18:38:55
\ Connecting to database√ Nuxt files generated
              18:39:08

× Client
  Compiled with some errors in 11.96s

√ Server
  Compiled successfully in 11.10s


 ERROR  Failed to compile with 5 errors                                   friendly-errors 18:39:25

These dependencies were not found:                                        friendly-errors 18:39:25
                                                                          friendly-errors 18:39:25
* core-js/modules/es6.regexp.to-string in ./dist/client.js, ./dist/components/nuxt-link.client.js
* core-js/modules/es7.promise.finally in ./dist/client.js                 friendly-errors 18:39:25
* core-js/modules/es7.symbol.async-iterator in ./dist/client.js, ./dist/components/nuxt-link.client.

js
                                                                          friendly-errors 18:39:25
To install them, you can run: npm install --save core-js/modules/es6.regexp.to-string core-js/module

s/es7.promise.finally core-js/modules/es7.symbol.async-iterator
i Waiting for file changes                                                                18:39:25
- Connecting to databaseError from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\

DumpStack.log.tmp'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys'
× Connecting to database
Error: connect ECONNREFUSED 127.0.0.1:27017
    at resolveAllKeys (C:\%projectfolder%\node_modules\@keystonejs\utils\dist\utils.cjs.dev.js:48:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Keystone.connect (C:\%projectfolder%\node_modules\@keystonejs\keystone\lib\Keystone\index.js:459:5)
    at async executeDefaultServer (C:\%projectfolder%\node_modules\@keystonejs\keystone\bin\utils.js:114:3) {
  errors: {
    MongooseAdapter: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
        at NativeConnection.Connection.openUri (C:\%projectfolder%\node_modules\mongoose\lib\connection.js:823:32)
        at Mongoose.connect (C:\%projectfolder%\node_modules\mongoose\lib\index.js:333:15)
        at MongooseAdapter._connect (C:\%projectfolder%\node_modules\@keystonejs\adapter-mongoose\lib\adapter-mongoose.js:59:25)
        at MongooseAdapter.connect (C:\%projectfolder%\node_modules\@keystonejs\keystone\lib\adapters\index.js:22:16)
        at C:\%projectfolder%\node_modules\@keystonejs\keystone\lib\Keystone\index.js:459:63
        at C:\%projectfolder%\node_modules\@keystonejs\utils\dist\utils.cjs.dev.js:22:10
        at Array.reduce (<anonymous>)
        at mapKeys (C:\%projectfolder%\node_modules\@keystonejs\utils\dist\utils.cjs.dev.js:21:52)
        at Keystone.connect (C:\%projectfolder%\node_modules\@keystonejs\keystone\lib\Keystone\index.js:459:26)
        at executeDefaultServer (C:\%projectfolder%\node_modules\@keystonejs\keystone\bin\utils.js:114:18)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:97:5) {
      reason: [TopologyDescription]
    }
  }
}
error Command failed with exit code 1.

System information

  • Windows 10 x64
  • Node.js 12.16.3, 10.16.3
  • yarn 1.22.4, 1.19.1

Additional context

I have had successful builds in the past weeks with this. I’ve lost a yarn.lock file on a previously working project and after downloading dependencies again, this error was thrown. While troubleshooting I figured I’d try running the default example and the same behavior occurred, so I’d guess something changed in dependencies.

Following the friendly-errors prompt to install the missing core-js packages results in a 405 error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
matheuschimellicommented, May 30, 2020

Just run npm i -S core-js@2.5.7. It solved my problem. Check this issue: https://github.com/keystonejs/keystone/issues/1843#issue-512929679

1reaction
dendihandiancommented, Jun 25, 2020

if you’re using yarn, it should be solved by running yarn add core-js@2.5.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Nuxt.js Build Failed - Stack Overflow
I've solved this problem by Updating Node Js to the latest version. Before I was using Node Js 10.x.
Read more >
Plugins directory - Nuxt
The plugins directory contains your Javascript plugins that you want to run before instantiating the root Vue.js Application.
Read more >
Tips You Must Know to Build Vue.js Projects with Nuxt.js
Using hook asyncData to fetch the data for dynamic routing slug. Network error means the link is wrong, just check the link. These...
Read more >
Creating Server-side Rendered Vue.js Apps Using Nuxt.js
This is a big indication that something is wrong with the application logic. Thankfully, an error will be generated in your browser's console...
Read more >
Nuxt 3 full course build and deploy | #Nuxtjs #vue #nuxt3
Learn # nuxtjs with all its new features in the #nuxt3 applicationnuxt 3 Course is for beginners and cover full course to advanced...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found