-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Errors when building on Windows (unable to identify chunk) #6864
Comments
Hello, thank you for reporting this issue. I think you can fix this by replacing this line chunk => chunkFiles.find(f => f.endsWith('/' + chunk.entry))); with chunk => chunkFiles.find(f => f.endsWith(path.sep + chunk.entry)));
As a side note, if you are only trying to use Blockly in an application (rather than contribute directly to it or a fork of it), you don't have to build it from scratch yourself. You can download the compiled code from npm or from our github releases. |
Regarding the crlf issue, I'll admit that I'm not all that familiar with this issue having not used windows in the past ~20 years. We also don't have a Thanks! |
This is still failing...
[11:07:16] Using gulpfile X:\BLOCKLY\gulpfile.js Any recommendation? |
Reopening this since PR #7127 didn't fix the build error, and didn't address the newline issue at all. |
I've moved the line ending issue to its own issue in #7191 |
I had another look at this because there are other areas where we use but more importantly here where we end up writing lines like |
I've found a temporary workaround on windows: Ln. 526 from ( chunk => chunkFiles.find(f => f.endsWith(path.sep + chunk.entry))); to: chunk => chunkFiles.find(f => f.endsWith(path.sep.replaceAll('\\', '/') + chunk.entry.replaceAll('\\', '/')))); With this change it successfully builds for me. |
See PR #7281. |
I believe this was fixed and is now almost certainly moot since PR #7469 deleted the code in question. |
Check for duplicates
Description
Running 'npm run start' produced the following error on Windows:
[22:52:24] Using gulpfile ~\Documents\GitHub\blockly\gulpfile.js
[22:52:24] Starting 'build'...
[22:52:24] Starting 'buildLangfiles'...
[22:52:24] Finished 'buildLangfiles' after 411 ms
[22:52:24] Starting 'buildJavaScript'...
Unquoted enums in 0 files.
[22:52:34] Finished 'buildJavaScript' after 9.85 s
[22:52:34] Starting 'buildDeps'...
[22:52:38] Finished 'buildDeps' after 3.48 s
[22:52:38] Starting 'buildCompiled'...
[22:52:41] 'buildCompiled' errored after 2.76 s
[22:52:41] Error: Unable to identify chunk
at C:\Users\perny\Documents\GitHub\blockly\scripts\gulpfiles\build_tasks.js:573:23
at Array.map ()
at getChunkOptions (C:\Users\perny\Documents\GitHub\blockly\scripts\gulpfiles\build_tasks.js:558:38)
at buildCompiled (C:\Users\perny\Documents\GitHub\blockly\scripts\gulpfiles\build_tasks.js:646:24)
at bound (node:domain:421:15)
at runBound (node:domain:432:12)
at asyncRunner (C:\Users\perny\Documents\GitHub\blockly\node_modules\bach\node_modules\async-done\index.js:55:18)
at processTicksAndRejections (node:internal/process/task_queues:78:11)
[22:52:41] 'build' errored after 17 s
Looking a little closer on the error, I was able to find the problem.
The chunk.entry had a windows separator (backslash) instead of the slash '/'. This was easy to fix by this thing:
// Convert windows path separators into '/' so that the entrypoint lookup works as intended
const chunkEntries = chunks.map(chunk => chunk.entry.replace(/\/g, '/'));
I thought it would be nice to make a PR as well, but it turned out that 1334 files had been modified newlines CRLF, so this was a no go.
Reproduction steps
Stack trace
Screenshots
No response
Browsers
No response
The text was updated successfully, but these errors were encountered: