facebook / react

The library for web and native user interfaces.

Home Page:https://react.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[DevTools Bug]: Hook parsing fails with fetch error

th3fallen opened this issue · comments

Website or app

https://p181.p1.n0.cdn.getcloudapp.com/items/4gulW8Wo/3bba0881-ee74-4478-8cb8-68370b878855.jpg?v=ab371b6e8fca2cee905d1b9f828ac0d8

Repro steps

have a webpack project that uses a domain mapped to your local IP such as (appx.whenidev.net) in my case that's served with https
try to resolve hook names
check console and observe the million errors

https://p181.p1.n0.cdn.getcloudapp.com/items/4gulW8Wo/3bba0881-ee74-4478-8cb8-68370b878855.jpg?v=ab371b6e8fca2cee905d1b9f828ac0d8 shows my console

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

Please provide a reproduce repo or a codesandbox for further investigation on the issue

I'm not sure I can setting as it depends on a particular webpack dev server setup

We need a repo for reproducing and for further investigation.
You can make a test repo with Webpack dev server setup and a normal example for this issue would be very helpful.

Don't forget to include Webpack.config.js

DevTools cannot currently load Webpack's "eval" source maps because their locations begin with "webpack-internal://". (There's no API that can fetch a resource at such a URL b'c that protocol doesn't exist.)

Open for ideas or suggestions here.

What source map would you recommend for dev mode with fast refresh?

Maybe "cheap-source-map"

I'll give it a try thanks

same problem!

Maybe "cheap-source-map"

FWIW cheap source map also does not work, gives no error in console though so I guess that's a plus

"cheap-source-map" is supported. We're using it in our local test app (react-devtools-shell). Maybe something else is going on in your project. Want to share a repro?

Sadly I can't it's my company's private gitlab instance, but I'll try to create a reproduction. I bet it's something with us using stage 0 stuff

commented

devtool: "cheap-module-source-map" work for me, cc @th3fallen @yaoweiprc , thanks every one