Skip to content
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

[v3.x.x] Windows build issue: Legacy octal escape sequences are not allowed in strict mode #4681

Closed
jerome-benoit opened this issue Oct 17, 2022 · 5 comments · Fixed by #4693
Assignees

Comments

@jerome-benoit
Copy link
Contributor

jerome-benoit commented Oct 17, 2022

Rollup Version

3.2.2

Operating System (or Browser)

Windows

Node Version (if applicable)

16.x 18.x

Link To Reproduction

See below

Expected Behaviour

No build error.

Actual Behaviour

Windows only build issue:

68 | [
69 | Requests.OCPP16IncomingRequestCommand.RESET,
> 70 | JSON.parse(fs.readFileSync(path.resolve(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (d
ocument.currentScript && document.currentScript.src || new URL('charging-station\ocpp\1.6\OCPP16IncomingRequestService.cjs', document.baseURI).href)))), '../../../assets/json-schemas/ocpp/1.
6/Reset.json'), 'utf8')),
|
^ Legacy octal escape sequences are not allowed in strict mode
71 | ],
72 | [
73 | Requests.OCPP16IncomingRequestCommand.CLEAR_CACHE,

100% reproductible on windows by building https://github.com/SAP/e-mobility-charging-stations-simulator after update to rollup 3.2.2 or superior.

2.79.1 version builds it fine.

@lukastaegert
Copy link
Member

It seems the default polyfill for import.meta.url created by Rollup does not work well on Windows.

@lukastaegert
Copy link
Member

Fix at #4693. It seems that the reworked logic for preserveModules was using the slash-type given by the operating system I its internal chunk ids (instead of always forward slashes), which was one part of the problem. The other part was that back-slashes were not properly escaped.

@jerome-benoit
Copy link
Contributor Author

I will try to validate the fix when time permits. Thanks.

@lukastaegert
Copy link
Member

I managed to confirm that it fixes your reproduction on a Windows VM, so I will go forward and merge the PR for now. If there are still issues, let me know.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4693 as part of rollup@3.2.4. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants