-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
esbuild-wasm (works for esbuild) fails to resolve imports from 'nodePaths' when entrypoints are not in the toplevel dir #3001
Comments
Workaround is to either use full paths when importing or omit the file extension. +import { Color } from '../lib/Color.jsx'; or +import { Color } from 'Color'; |
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
Thanks for the report. It looks like this is because Go returns |
Amazing, thanks @evanw for the super-fast fix! |
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
Unfortunately, scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files: evanw/esbuild#3001 Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: ``` for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done ``` And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
@evanw : As this is awkward to work around, do you plan to do a new release with this soon? (Sorry for nagging, this is to plan whether we should go with the ugly workaround, or just wait for the next release). Thanks! |
Yeah I should do a release. Thanks for the bump. I'll try to get one out in the next day or so. |
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
evanw/esbuild#3001 Unfortunally scss imports with non relative paths still don't work with esbuild-wasm if these are inside jsx files. Use relative paths for importing scss from JS. Same for .sh and .py files processed by the raw loader. Replacement done with: for file in $(ls pkg/lib); do echo 'Processing' $file; base=$(basename $file) find pkg/ -type f -exec sed -i "s/$base/${base%.*}/g" {} +; done And fixed up the rest manually.
Running esbuild-wasm here fails to resolve Color.jsx file from ./lib directory
When using the esbuild binary instead of the esbuild wasm, it works as expected, so this issue is only present for the esbuild-wasm.
Using full path instead of the relative path in the nodePaths, does not seem to help either.
The text was updated successfully, but these errors were encountered: