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

Malformed regex in CJS loader on Linux/Mac #287

Closed
daniacedue opened this issue Apr 24, 2024 · 2 comments · Fixed by #288
Closed

Malformed regex in CJS loader on Linux/Mac #287

daniacedue opened this issue Apr 24, 2024 · 2 comments · Fixed by #288
Assignees

Comments

@daniacedue
Copy link

Hello,

When publishing a NAOT node package with dotnet utility on Linux or Mac, the Common JS loader for the library has a syntax error:
const moduleName = path.basename(__filename, __filename.match(/(/.[cm]?js)?$/)[0]);

On the other hand, when publishing on Windows, there is no error:
const moduleName = path.basename(__filename, __filename.match(/(\.[cm]?js)?$/)[0]);

Perhaps it has something to do with the generator using OS-dependent paths in regex (when it should not)?

Thanks

@jasongin
Copy link
Member

Oh, that's odd. It seems to be some strange behavior of MSBuild WriteLinesToFile, which is used to apply some transformations to that file when publishing as AOT. I'll figure out a workaround.

@jasongin jasongin self-assigned this Apr 25, 2024
@jasongin
Copy link
Member

Yep, it's a bug in MSBuild: dotnet/msbuild#3468

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

Successfully merging a pull request may close this issue.

2 participants