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: Astro.new starters throw a few errors and many assorted warnings in the browser inspector #3403

Closed
1 task
KyleFontenot opened this issue May 19, 2022 · 9 comments · Fixed by #3744
Closed
1 task
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@KyleFontenot
Copy link

What version of astro are you using?

1.0.0-beta.30

Are you using an SSR adapter? If so, which one?

no

What package manager are you using?

npm

What operating system are you using?

Mac locally. StackBlitz throws same errors too though

Describe the Bug

Errors

Using just the basic starter template from Astro.new for solid, Here is the error thrown:

5:01:41 PM [vite] Internal server error: Cannot set properties of undefined (setting 'isSelfAccepting')
  Plugin: vite:import-analysis
  File: /home/projects/kkvinqjga.github/node_modules/.vite/deps/astro_client_visible_js.js?v=da542fda
      at ModuleGraph.updateModuleInfo (/home/projects/kkvinqjga.github/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:57342:29)
      at TransformContext.transform (/home/projects/kkvinqjga.github/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:57117:57)
      at async Object.transform (/home/projects/kkvinqjga.github/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38900:30)
      at async doTransform (/home/projects/kkvinqjga.github/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:55857:29)

Within the browser visible.js throws:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Warnings

Two warnings throw referencing /@id/...

DevTools failed to load source map: Could not load content for https://kkvinqjga--github--3000.local.webcontainer.io/@id/@astrojs/solid-js/@astrojs_solid-js_client_js.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

While hundreds of warnings relate to /node_modules/... all ending in .map:

DevTools failed to load source map: Could not load content for https://kkvinqjga--github--3000.local.webcontainer.io/node_modules/.vite/deps/chunk-Q54O36CC.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-solid?file=package.json&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added this to Needs Triage in 🐛 Bug Tracker May 19, 2022
@KyleFontenot
Copy link
Author

dperolio on Discord mentioned that he gets exact errors without Solid. (s)he has React involved but doesn't look like the culprit. Looks Astro - Vite related especially with the thrown error

@natemoo-re
Copy link
Member

Thanks for the report! Good to know that this isn't Solid-specific but is something to do with the /@id/ URLs we're using internally.

Since this is happening with our out-of-the-box starter templates, we'll try to get to this as soon as possible.

@natemoo-re natemoo-re moved this from Needs Triage to Accepted in 🐛 Bug Tracker May 19, 2022
@natemoo-re natemoo-re added - P4: important Violate documented behavior or significantly impacts performance (priority) s2-medium labels May 19, 2022
@FredKSchott FredKSchott added - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) and removed - P4: important Violate documented behavior or significantly impacts performance (priority) labels May 20, 2022
@scott-the-brewer
Copy link

scott-the-brewer commented May 23, 2022

Just wanted to add, I'm encountering the same issue when upgrading from beta.28 to beta.29. I'm using solid-js.

@scott-the-brewer
Copy link

I've looked into this, I'm pretty confident this is an issue with Vite.

In doTransform in transformRequest.ts .

It first resolves an id: const id = (await pluginContainer.resolveId(url, undefined, { ssr }))?.id || url

Then it calls: const loadResult = await pluginContainer.load(id, { ssr }), which will optimize the dependency and therefore a new ID will be assigned (different hash).

Then later down the track: const mod = await moduleGraph.ensureEntryFromUrl(url, ssr)
This will add the entry to the moduleGraph, but under the new ID

And then shortly after it calls:

  const transformResult = await pluginContainer.transform(code, id, {
    inMap: map,
    ssr
  })

Which uses the old ID, that isn't inside the moduleGraph.

I think the fix for this would be simple, in the above use mod.id instead of id, so it uses the new ID.

I don't have time to create an issue on the Vite repo and PR, happy for someone else to do that (otherwise if I have time I can do it later this week).

@natemoo-re natemoo-re changed the title 🐛 BUG: Astro.new's solid starter throws a few errors and many assorted warnings in the browser inspector 🐛 BUG: Astro.new starters throw a few errors and many assorted warnings in the browser inspector May 27, 2022
@natemoo-re natemoo-re self-assigned this May 27, 2022
@FredKSchott FredKSchott assigned bholmesdev and unassigned natemoo-re Jun 1, 2022
@bholmesdev
Copy link
Contributor

The isSelfAccepting error should now be resolved in the latest beta! See #3521

I'm also unable to replicate the "DevTools failed to load source map" warnings after the upgrade. Mind confirming before I close @KyleFontenot and/or @scott-the-brewer?

@scott-the-brewer
Copy link

@bholmesdev Working great for me thanks, no issues

🐛 Bug Tracker automation moved this from Accepted to Done Jun 6, 2022
@connorads
Copy link
Contributor

connorads commented Jun 7, 2022

Still broken when running astro dev here on connorads/connoradams.co.uk#13 with beta.41
astro dev Cannot set properties of undefined (setting 'isSelfAccepting')
astro build works fine

Didn't manage to narrow down the exact cause yet
But if anyone is curious and wants to reproduce and investigate

  1. Clone https://github.com/connorads/connoradams.co.uk
  2. npm ci
  3. npm run dev or npx astro dev
  4. View website
  5. See error in console
    image
    image

@ghost
Copy link

ghost commented Jun 7, 2022

@connorads Yep, we have a few reports of similar issues. Looks like we fixed the issue on our starters and other “small” starters, but it reappears at scale. Currently tracking on #3465

@bholmesdev
Copy link
Contributor

bholmesdev commented Jun 10, 2022

Noticing the js.map warning logs were not resolved. We have a Vite core fix for the isSelfAccepting issue that might address this as well, but I'm re-opening to track!

@bholmesdev bholmesdev reopened this Jun 10, 2022
🐛 Bug Tracker automation moved this from Done to Needs Triage Jun 10, 2022
@bholmesdev bholmesdev added - P3: minor bug An edge case that only affects very specific usage (priority) and removed - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) labels Jun 20, 2022
@FredKSchott FredKSchott added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed - P3: minor bug An edge case that only affects very specific usage (priority) labels Jun 24, 2022
🐛 Bug Tracker automation moved this from Needs Triage to Done Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants