Skip to content
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] Failed to load a lazy component #1241

Open
2 of 3 tasks
hsccode opened this issue Mar 12, 2025 · 1 comment
Open
2 of 3 tasks

[BUG] Failed to load a lazy component #1241

hsccode opened this issue Mar 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@hsccode
Copy link

hsccode commented Mar 12, 2025

What happened?

`import React, { lazy, Suspense } from 'react';
// import PageA from '~components/pageA';

const PageA = lazy(() => import('~components/pageA'));

const Main = () => {
return (


Hello, world!


<Suspense fallback={
Loading...
}>



);
}

export default Main;`

正常导入是没问题的,lazy后就报错contents.85aba5ab.js:62 Uncaught Error: Cannot find module 'g4bVG'
at newRequire (contents.85aba5ab.js:62:19)
at newRequire (main.9970a2cc.js:54:18)
at newRequire (main.9970a2cc.js:46:18)
at main.9970a2cc.js:25456:27

contents.85aba5ab.js:16860 The above error occurred in one of your React components:

at Lazy
at Suspense
at div
at Main
at div
at OverlayCSUIContainer (chrome-extension://nklcmllngbklfhkgodhhmacnijcafjpf/contents.85aba5ab.js:24883:54)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

这是在contents里面的引入

Version

Latest

What OS are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Relevant log output

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@hsccode hsccode added the bug Something isn't working label Mar 12, 2025
@Xheldon
Copy link

Xheldon commented Mar 21, 2025

I think the reason for this prob is the same as #1180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants