`bundle` produces invalid entrypoint on Windows
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top 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 >
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 Free
Top 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

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.
requiresupports mixing\and/on Windows so just using the POSIX relative path would work.