-
Notifications
You must be signed in to change notification settings - Fork 131
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
[Bug]: After building and running preview locally, error message: Cannot read properties of undefined (reading 'call') #2934
Comments
This problem seems to be related to rspack. The treeshaking optimization of build has led to the loss of some modules. |
Hello @JayMo666. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️ |
Here is a repo with the same error... You can run with "npm start" and it will run normally... but, if you run "npm run build"... it will throw this same error. |
investigationThis error message may correspond to multiple errors. As for https://github.com/belizariogr/rsbuild-error, it is related to Rspack.
the behavior in webpack is correct. |
The error message may be the same, but the reasons for the error may be different. Could you provide a minimum reproduction? :D |
I've got the same error, this is the non-transpiled code. In another working build, the transpiled code looks like this. |
I've just realized that the difference between the two builds is that the working one, I used to have only one Source Entry and for the non-working one I have 3 entries, which imports the same "lib" in this case "react-i18next" |
@belizariogr @JayMo666 this issue has been solved in web-infra-dev/rspack#7170 and the fix will be included in the next release. If you'd like to try out it at this moment, please overrides Setting |
@kamalbennani There could be another underlying cause for your issue. If the nightly version of @rspack/core doesn't help you out, please feel free to open a new issue with repro. |
Setting |
Setting |
+1 |
Problems remain! |
Please create a new issue and provide an reproduction |
There is no problem if you cancel the compression, and the problem only occurs before Chrome 109. I suspect it is still a compression problem. |
Version
Details
报错如下:
把e[a].call(r.exports, r, r.exports, n)改为 return e[a]?.call(r.exports, r, r.exports, n) 就可以解决,增加可选符号。
本地运行 pnpm run dev 是没问题的,可以访问。
rsbuild.config.ts文件:
Reproduce link
无
Reproduce Steps
1、
2、
The text was updated successfully, but these errors were encountered: