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.

`bundle` produces invalid entrypoint on Windows

See original GitHub issue

Describe the bug

Running yarn bundle on Windows produces an entrypoint.js file that uses a backslash causing the script to crash.

This is due to the use of the path module and its sep value https://github.com/ojkelly/yarn.build/blob/e47d1197d5a02bd4f7f92a3d0b262cc00f2ceed2/packages/plugins/plugin-build/src/commands/bundle/index.ts#L387-L388 producing this output:


"use strict";

const pnp = require("./.pnp.cjs").setup();

const index = require("./.\register.js");

Object.defineProperty(exports, "__esModule", { value: true });

exports.default = index;

To Reproduce

Run the following in Git Bash on Windows

set -ex

cd $(mktemp -d)

yarn init -2
yarn plugin import https://yarn.build/latest

touch register.js
printf '{"main": "register.js"}' > package.json

TARGET="$(mktemp -d)"
yarn bundle --no-compress --output-directory "$TARGET"
node "$TARGET/entrypoint.js"

Expected behavior

The entrypoint should use a forward slash to ensure it works on Windows

Desktop (please complete the following information):

  • OS: Windows 10

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ojkellycommented, Oct 26, 2021

Thanks for this @merceyz. I don’t develop or deploy on Windows, but there’s been a number of Windows specific improvements and fixes thanks to @misterjoshua. Including our E2E tests on Windows.

in #135 I’ve had a start at a proper fix, and updated the windows test to confirm.

0reactions
merceyzcommented, Dec 30, 2021

require supports mixing \ and / on Windows so just using the POSIX relative path would work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker - entrypoint file not found - Stack Overflow
I had this problem with Docker for Windows and the solution was changing the entrypoint script file from CRLF -> LF.
Read more >
Troubleshooting packaging, deployment, and query of ...
Error code Value Description and possible causes E_INVALIDARG 0x80070057 ERROR_INSTALL_INVALID_ PACKAGE 0x80073CF2 The package data isn't valid. ERROR_INSTALL_NETWORK_ FAILURE 0x80073CF5 The package can't be downloaded.
Read more >
Special characters in entrypoint paths are always forcibly ...
Currently, esbuild replaces certain characters in entrypoint filenames for the corresponding output filenames when bundle is false.
Read more >
Container Images - Quarkus
container-image.push unset - it defaults to false ), then this extension creates a container image and registers it with the Docker daemon. This...
Read more >
microbundle - npm
Microbundle produces esm , cjs , umd bundles with your code compiled to syntax that works pretty much everywhere. While it's possible to ......
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