thetarnav / solid-devtools

Library of developer tools, reactivity debugger & Devtools Chrome extension for visualizing SolidJS reactivity graph
https://chrome.google.com/webstore/detail/solid-devtools/kmcfjchnmmaeeagadbhoofajiopoceel
MIT License
538 stars 21 forks source link

Debugger hasn't found the exposed Solid Devtools API. Did you import the setup script? #250

Open astoilkov opened 1 year ago

astoilkov commented 1 year ago

The error is thrown regardless of the fact I call attachDevtoolsOverlay(). I don't call attachDevtoolsOverlay() in the entry file because DevTools is blank and doesn't work.

We load the app async in the entry file, something like:

loadApp(async () => {
  await loadFonts()
  const { App } = await import('./App.tsx')
  render(() => <App />, document.body)
})

Also, worth mentioning:

image

thetarnav commented 1 year ago

interesting the overlay package is importing the setup, so it should always be available: https://github.com/thetarnav/solid-devtools/blob/main/packages/overlay/src/index.tsx#L1 Maybe the import got removed by the bundler for some reason? you could try adding that import manually I'm kinda loading the app asynchronously in my playground too, so it shouldn't be an issue: https://github.com/thetarnav/solid-devtools/blob/main/examples/sandbox/src/index.ts

astoilkov commented 1 year ago

Ok, yes, you are right. Adding import '@solid-devtools/debugger/setup' in the entry file did work.

If you decide you can close this.

Now the useLocator() doesn't work. I debugged it and registerComponent() is never called and ComponentMap is empty. Should I open a new issue for this?