On windows_nt aka win10 setting target - static option breaks build.
See original GitHub issueEnvironment
Nuxt project info:
- Operating System:
Windows_NT
- Node Version:
v16.14.2
- Nuxt Version:
3.0.0-27498764.32c798c
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
target
,telemetry
,meta
,components
,css
,build
- Runtime Modules:
-
- Build Modules:
-
Reproduction
just set target: ‘static’ - makes a bug on working basic code on windows 10.
Describe the bug
Enabling: "target: ‘static’, " in nuxt.config.ts breaks build and generate:
D:\Dev\nuxt3-tw3-base>make build
Nuxt CLI v3.0.0-27498764.32c798c 15:04:48
i Vite client warmed up in 810ms 15:04:52
i Client built in 1909ms 15:04:53
i Building server... 15:04:53
√ Server built in 583ms 15:04:53
√ Generated public .output/public nitro 15:04:53
start Preparing prerenderer... nitro 15:04:53
ERROR Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
at new NodeError (node:internal/errors:371:5)
at throwIfUnsupportedURLProtocol (node:internal/modules/esm/resolve:1035:11)
at defaultResolve (node:internal/modules/esm/resolve:1105:3)
at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
at ESMLoader.import (node:internal/modules/esm/loader:332:22)
at importModuleDynamically (node:internal/modules/esm/translators:106:35)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
at prerender (/D:/Dev/nuxt3-tw3-base/node_modules/nitropack/dist/chunks/prerender.mjs:2169:39)
at async /D:/Dev/nuxt3-tw3-base/node_modules/nuxt3/dist/index.mjs:1215:9
makefile:37: recipe for target 'build' failed
make: *** [build] Error 1
Additional context
probably nitro issue.
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Resolved issues in Windows 10, version 20H2 | Microsoft Learn
In this article. Resolved issues; Issue details. See a list of known issues that have been resolved for Windows 10, version 20H2 over...
Read more >Updating List of Trusted Root Certificates in Windows
In this article, we'll try to find out how to manually update the list of root certificates in TrustedRootCA in disconnected (isolated) networks...
Read more >Windows 10 SDK Preview Build 17763 available now!
Today, we released a new Windows 10 Preview Build of the SDK to be used ... apps that target Windows 10 build 1803...
Read more >R for Windows FAQ - The Comprehensive R Archive Network
By default, most versions of Windows have short names (aka ... You can also set environment variables at the end of the Target...
Read more >Windows 10 22H2 is released, here's what we know
Microsoft has announced the availability of Windows 10, version 22H2 (aka the Windows 10 2022 Update), now rolling out to all eligible ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe that these are all related: https://github.com/nuxt/framework/issues/4330 https://github.com/nuxt/framework/issues/4350 https://github.com/nuxt/framework/issues/4256 https://github.com/nuxt/framework/issues/4232
The issue is present for
nuxt generate
,nuxi generate
, andnuxi build
withtarget: static
. However is isn’t present when building using the following settings in nuxt.config.This setting doesn’t work using
nuxi dev
however. When running dev, this error is shown:To view the issue, please see this repo: https://github.com/mctweb/nuxt3-example
I’ve run the different commands and commited them to different branches. The output files have been included. Please see the Readmes for relevant error messages.
This should be resolved in the latest nitropack. Let me know if not and I can reopen.