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

TypeError: Cannot read properties of undefined (reading 'length') #23

Open
ViZiD opened this issue Sep 7, 2023 · 2 comments
Open

TypeError: Cannot read properties of undefined (reading 'length') #23

ViZiD opened this issue Sep 7, 2023 · 2 comments

Comments

@ViZiD
Copy link

ViZiD commented Sep 7, 2023

The error occurred on https://ivan-stoychev.com/ and a couple of other sites where entrypoint starts with webpackJsonpreact-*

Debug info:

Entrypoint has been detected at window.webpackJsonpreact-tours and set for injection

[moduleRaid] Pushing moduleRaid.arrayArguments[0] into webpackJsonpreact-tours failed:
TypeError: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
at t (https://ivan-stoychev.com/:1:1261)
at Array.r [as push] (https://ivan-stoychev.com/:1:1186)
at https://unpkg.com/moduleraid/dist/moduleraid.iife.js:1:1742
at Array.forEach ()
at n.fillModules (https://unpkg.com/moduleraid/dist/moduleraid.iife.js:1:1642)
at new e (https://unpkg.com/moduleraid/dist/moduleraid.iife.js:1:1075)
at HTMLScriptElement. (:4:55)

[moduleRaid] Pushing moduleRaid.arrayArguments[1] into webpackJsonpreact-tours failed:
TypeError: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
at t (https://ivan-stoychev.com/:1:1261)
at Array.r [as push] (https://ivan-stoychev.com/:1:1186)
at https://unpkg.com/moduleraid/dist/moduleraid.iife.js:1:1742
at Array.forEach ()
at n.fillModules (https://unpkg.com/moduleraid/dist/moduleraid.iife.js:1:1642)
at new e (https://unpkg.com/moduleraid/dist/moduleraid.iife.js:1:1075)
at HTMLScriptElement. (:4:55)

Error:

Uncaught Error: Unknown Webpack structure
at n.fillModules (moduleraid.ts:211:15)
at new e (moduleraid.ts:148:10)
at HTMLScriptElement. (:4:55

@pixeldesu
Copy link
Owner

Hmm, to give a status update on this, I actually have no idea how to solve this problem specifically.

There's a method in the runtime that "somehow" (?) isn't accessible after the intended chunks are loaded, so injecting a new one doesn't work.

I tried a few options already and haven't found a workaround for this yet. So it technically failing with Unknown Webpack structure is correct here 😄

Your issue states other websites also have this, could you list some more examples?

@ViZiD
Copy link
Author

ViZiD commented Sep 29, 2023

Hi! The sites I mentioned have authorization, and there is no English localization. I have something better, I did a little digging and found out that applications built with create-react-app version 3.x and 4.x look the same, the same structure, and the same error.
I did eject on version 3.4.1 and deployed the redux toolkit counter app to the cloudflare page
link to repo
Maybe this will help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants