nuxt: Fresh create nuxt app not starting properly on Windows 10

Environment

Nuxt CLI v3.0.0-27234123.a896c64
OS: Windows 10 Build 19043 Node: 14.17.0 Npm: 6.14.8

Describe the bug and expected behavior

When running npm run dev -o, it builds properly and starts for a second, but then the console fills with the following messages

  > Local:    http://localhost:3000/
  > Network:  http://192.168.56.1:3000/
  > Network:  http://192.168.0.102:3000/

√ Generated nuxt.d.ts                                                                                                                                            17:12:10
i Vite warmed up in 1580ms                                                                                                                                       17:12:10
√ Vite server built in 1915ms                                                                                                                                    17:12:11
√ Vite server built in 55ms                                                                                                                                      17:12:11
√ Nitro built in 304 ms                                                                                                                                          17:12:11
√ Vite server built in 32ms                                                                                                                                      17:12:11
√ Vite server built in 27ms                                                                                                                                      17:12:11
√ Vite server built in 60ms                                                                                                                                      17:12:11
√ Vite server built in 75ms                                                                                                                                      17:12:12
√ Vite server built in 29ms    
Server Side Rendering Error: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:782:11)
    at Loader.resolve (internal/modules/esm/loader.js:88:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:241:28)
    at Loader.import (internal/modules/esm/loader.js:176:28)
    at importModuleDynamically (internal/modules/esm/translators.js:114:35)
    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
    at $id_60f0615f (file:///C:/Users/X/Desktop/projects/nuxt3-app/.nuxt/dist/server/server.mjs:84:185)
    at __instantiateModule__ (file:///C:/Users/X/Desktop/projects/nuxt3-app/.nuxt/dist/server/server.mjs:1798:9)
    at __ssrLoadModule__ (file:///C:/Users/X/Desktop/projects/nuxt3-app/.nuxt/dist/server/server.mjs:1746:25)
    at ssrImport (file:///C:/Users/X/Desktop/projects/nuxt3-app/.nuxt/dist/server/server.mjs:1770:13) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

The Vite server build in XXX is getting called recursively and doesnt stop.

Steps to reproduce

  1. npx nuxi init nuxt3-app
  2. code -r nuxt3-app
  3. npm install
  4. npm run dev -o

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 18
  • Comments: 23 (10 by maintainers)

Commits related to this issue

Most upvoted comments

This seems a vite issue. In the meantime, you can use webpack@5 by adding this nuxt.config.ts:

import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
  vite: false
})

Windows 10. Same issue here. Clean install.

From Discord it is reported to be the same issue with Linux.

Sure, here you go:

➜  npx nuxi info
Nuxt CLI v3.0.0-27234267.6e52775                                                                              18:32:55
RootDir: D:\Code\playground\nuxt3-app                                                                         18:32:56
Nuxt project info:                                                                                            18:32:56

------------------------------
- Operating System: `Windows_NT`
- Node Version:     `v16.10.0`
- Nuxt Version:     `3-3.0.0-27234267.6e52775`
- Package Manager:  `npm`
- Bundler:          `Webpack`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`
------------------------------

I got a new error after retrying (I updated in between):

EDIT: I should add that the welcome page worked, except for a bit of CSS

I’m still having this issue late in 2022. Will it not be resolved?

Aside from console spam, it works for me on windows (just spam)

Sure thing, wasnt sure if it was related

Hi @pi0 I removed the nodes_modules and yarn.lock but still not working. Here is the npx nuxi info result :

Nuxt CLI v3.0.0-27234169.3c132a8                                                          
RootDir: G:\PROJECTS\Testing\NUXT\nuxt3-app                                     
Nuxt project info:                                                                         

------------------------------
- Operating System: `Windows_NT`
- Node Version:     `v16.8.0`
- Nuxt Version:     `3-3.0.0-27234169.3c132a8`
- Package Manager:  `Yarn`
- Bundler:          `Webpack`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`
------------------------------

Thanks but even with the hotfix it is still not working for me on Windows 10. Getting the same error. Vite build loop is fixed though.

Awesome! Thanks for confirming. Let’s track the webpack issue (https://github.com/nuxt/nuxt.js/issues/11891) in another issue 😃