evanw / evanw/esbuild

Incorrect to compile `sass` source code

Open
#3,673 2 comments 0 reactions 0 assignees View on GitHub
unactionable
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

The `require` of `sass.dart.js` will be rename to `__require`
![image](https://github.com/evanw/esbuild/assets/48887270/6279598e-ba14-43f6-ad14-39d783d20f1a)
![image](https://github.com/evanw/esbuild/assets/48887270/6a1f7f8e-1211-4627-9c81-83d47a177393)
But esbuild use global `require` to access object property
![image](https://github.com/evanw/esbuild/assets/48887270/9ace2961-f3fd-4e77-a416-cb9d30044dff)
It will make `Uncaught RangeError: Maximum call stack size exceeded` when using `monaco-editor`
![image](https://github.com/evanw/esbuild/assets/48887270/2aa68f4e-1702-4769-9592-c55ed8f9c878)
Maybe esbuild should only rename the expression of calling function

This is a minimal reproduction link: https://codesandbox.io/p/devbox/esbuild-issue-ws2f3n

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked CodeSandbox minimal reproduction and inspect the generated code around the renamed `require` call and the global `require` property access. Confirm the `monaco-editor` case produces the reported maximum call stack error; done means the reproduction no longer fails because of this renaming interaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sass
Domain
build-system, compilers, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.