New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows builds broken: Rollup creates files with colons in the name #16
Comments
I see this seemingly-related line over in the rollup const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js'; I'm not quite sure what's going on there, but I think from looking at other code in that repo that @thgh -- you were the last person to touch that line. Any ideas? 😄 🤞 |
Aha, interesting. Over in rollup/rollup#3342 some tests were recently updated to no longer use - var _virtual_entry1 = exports('default', "\u0000virtual:entry-1");
+ var _virtualEntry1 = exports('default', "\u0000virtual-entry-1");
Is this a case of the test being updated, but the convention not being updated in the many places that use it? |
I've been doing a bit of investigation on my snowpack-v3 branch, which introduces another invalid file name:
This seems possibly related to this line of code? https://github.com/snowpackjs/rollup-plugin-polyfill-node/blob/main/src/index.ts#L8 |
OK, I think I've got it. rollup has this: export function sanitizeFileName(name: string): string {
return name.replace(/[\0?*]/g, '_');
} which strips the |
And it's not that simple, because while the function is called |
Several Rollup plugins use "virtual modules" (starting with \0) as recommended in the Rollup documentation. These virtual modules must be resolved & loaded in the plugin itself, otherwise they will end up as "external". No idea what's going on here though. |
This comment has been minimized.
This comment has been minimized.
Wooo, looks like this might be fixed soon. 🤞 |
So that fix got released in 3.8.5. I'm trying out 3.8.8 but ran into this blocker: |
Nope. Have to wait for new releases of esinstall and snowpack. See: FredKSchott/snowpack#3606 (comment) |
Opened a new bug for Snowpack to request they actually bump the dependency version so we can use the fix. :p |
Well, we're coming up on a year of this issue being open. I think I'm going to try some Snowpack alternatives. Vite looks like a good one to try first: https://vitejs.dev/ |
Had some issues with Vite. And Rollup. And webpack. But ESBuild (with some plugins) was easy to get working, and builds a fully bundled and minified app fast enough that I can just use that for dev mode. So the next version of FeoBlog should be buildable and available on Windows. :D 🎉 |
Summary
When Snowpack generates files via
snowpack build
, it ends up generating files that have colons in the name.Initially, these seem to work when I'm running the rust server in dev. mode, which passes through file requests to the underlying file system. However, when I attempt to do a release build, which bundles files up into the executable, the required files do not exist.
This also breaks the ability for rollup to do a release build. It itself can't find the files it generated. 😣
Steps to reproduce
cd feoblog/web-client
npm install
npm run build
Take a look in
build/web_modules/common
__node-resolve:empty-1777c4cc.js
__node-resolve
. It will be 0 bytes.This is because file names can't have a colon in them on Windows. However, file paths can have a colon in them, which causes the bit after the colon to be interpreted as a stream when using NTFS file systems. You can see this in this output:
This issue still exists even if I upgrade to Snowpack v3.
I'm not sure if this is a Snowpack bug or a Rollup bug, so I've just reported it here against my own code until I find the culprit. :)
A bit more detail
This seems to work in dev mode because the expected file name is directly requested via the browser. RustEmbed then asks the filesystem for that file path, which also ends up opening the NTFS data stream.
However, bundling the files likely just lists files on disk and tries to include them in the binary. Likewise, copying or zipping the files would probably break this functionality. Right now this is a blocker to having a working feoblog web client on Windows. 😢
See:
Current Status
To do:
:
in file names. rollup/rollup#3972Ping the Snowpack team to create a release w/ that version.Update Feoblog to use that version of SnowpackThe text was updated successfully, but these errors were encountered: