-
Notifications
You must be signed in to change notification settings - Fork 414
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
@linaria/babel-preset
's resolver cannot resolve node builtin modules
#1353
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
bundler: webpack 📦
Issue is related to webpack bundler
needs: complete repro 🖥️
Issue need to have complete repro provided
Comments
Shinyaigeek
added
bug report 🦗
Issue is probably a bug, but it needs to be checked
needs: complete repro 🖥️
Issue need to have complete repro provided
needs: triage 🏷
Issue needs to be checked and prioritized
labels
Sep 26, 2023
github-actions
bot
added
bundler: webpack 📦
Issue is related to webpack bundler
and removed
needs: triage 🏷
Issue needs to be checked and prioritized
labels
Sep 26, 2023
i get this error on my project after update to 5.0.2
|
@straxico, you need to add
|
Hi @Shinyaigeek! Thank you for your report! The problem was fixed. |
Merged
@Anber v5.0.3 works fine in my application, Thank you!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
bundler: webpack 📦
Issue is related to webpack bundler
needs: complete repro 🖥️
Issue need to have complete repro provided
Environment
Description
Thank you for developing nice tool!
My service uses linaria. My service is based on react + webpack. I develop react based application, and build(bundle, transpile, and also process linaria stylesheet) it with webpack. I uses
linaria/webpack-loader
to process linaria stylesheet on building. And also, I take a snapshot testing for the react component styled with linaria, with jest. To make linaria's processor work on jest, I uses@linaria/babel-preset
with babel configuration for the testing environment.With
v5.0.2
,linaria/webpack-loader
works fine so I can build my service correctly, but I cannot test my service because linaria's processor fail with below message.This is caused in resolving nodejs's builtin
url
package.In my application, I prepare some styling tokens for the stylesheet, such as
color: black
. These styling tokens include icon's url, such asurl(~~)
and icon's url is built with nodejs's builtinurl
module.example)
linaria/babel-preset
seems to fail in resolving nodejs's builtinurl
module.I assume this difference is caused by module resolver's difference.
linaria/webpack-loader
uses module resolver (asyncResolver
) based on the webpack's resolver (ref: https://github.com/callstack/linaria/blob/master/packages/webpack5-loader/src/index.ts#L71), butlinaria/babel-presets
uses module resolver (syncResolver
) based on thelinaria/utils
(ref: https://github.com/callstack/linaria/blob/master/packages/utils/src/asyncResolveFallback.ts#L19)Reproducible Demo
I create reproduction: https://github.com/Shinyaigeek/linaria-babel-plugin-resolver-bug-report
The text was updated successfully, but these errors were encountered: