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.

On windows_nt aka win10 setting target - static option breaks build.

See original GitHub issue

Environment

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:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mctwebcommented, Apr 14, 2022

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, and nuxi build with target: static. However is isn’t present when building using the following settings in nuxt.config.

nitro: {
    preset: 'nitro-prerender',
  }

This setting doesn’t work using nuxi dev however. When running dev, this error is shown:

Error: [worker] exited
    at Worker. (file:///C:/Users/Fraser/Websites/2022/nuxt3-test/node_modules/nitropack/dist/chunks/prerender.mjs:2038:14)
    at Object.onceWrapper (events.js:520:26)

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.

0reactions
danielroecommented, Jun 16, 2022

This should be resolved in the latest nitropack. Let me know if not and I can reopen.

Read more comments on GitHub >

github_iconTop 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 >

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