-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
ReferenceError: __name is not defined (LESS stylesheets) #174
Comments
You can debug your project to identify which dependency is using |
Hmm, I tried setting |
That was just an example for
It's in your error stack:
No. As the issues I referenced indicate, tsx doesn't support Why are you using tsx to run Webpack, anyway? |
We're currently using Node + Babel to run webpack, but in general we're trying to move off of Babel. We've migrated all our other tooling and packages to use esbuild and webpack is the last holdout. Eventually I want to move to something like Vite, but we need to use webpack for now. esbuild was a great drop-in replacement for rollup, so I wanted to see if it would work for webpack too. |
Why? |
Sorry, I should clarify that by "webpack" I mean the webpack dev server. We have a server written in TypeScript that needs to be run. |
That makes a lot more sense. In the future, tsx may become smarter about excluding dependencies from transpilation when unnecessary. That may unblock your issue. |
Reproduction!! If used tsx to run node.js cli app which has webpack , tsx will add __name for webpack hot module replacement function statement |
FYI this is no longer an issue with the latest tsx |
Bug description
I'm trying to migrate my webpack app from Babel to
tsx
and I'm running into a problem. The webpack build mostly completes, but then spits out hundreds of errors, one for every LESS stylesheet in the project. Each error looks like this:Reproduction
This is a very large enterprise project, so I can't provide a repro easily right now. I'm happy to work with you and provide more information, because I'd really love to ditch Babel.
Environment
Can you work on a fix?
The text was updated successfully, but these errors were encountered: