withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.65k stars 2.48k forks source link

🐛 BUG: Error when evaluating SSR module / module is not defined on fresh @next #1682

Closed hans-d closed 3 years ago

hans-d commented 3 years ago

What package manager are you using?

npm

What operating system are you using?

linux docker

Describe the Bug

fresh barebone/manual install of astro@next--compiler, with basic page results in errors

Steps to Reproduce

  1. running in docker container 'node:latest' without anything extra installed in the image. Current PWD is shared and current working dir within the container.
  2. npm init --yes
  3. npm install astro@next--compiler --save
    "dependencies": {
    "astro": "^0.0.0-compiler-202192719637"
    }
  4. add page as per https://github.com/snowpackjs/astro/blob/next/docs/src/pages/installation.md
  5. astro dev
07:53 PM [astro] Server started                               1908ms
07:53 PM [astro] Local: http://0.0.0.0:3000
7:53:28 PM [vite] Error when evaluating SSR module /node_modules/react/index.js?v=627d6032:
ReferenceError: module is not defined
    at /node_modules/react/index.js?v=627d6032:6:3
    at instantiateModule (/blog/node_modules/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js:66511:15)
7:53:28 PM [vite] Error when evaluating SSR module @astrojs/renderer-react/server.js:
ReferenceError: module is not defined
    at /node_modules/react/index.js?v=627d6032:4:3
    at instantiateModule (/blog/node_modules/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js:66511:15)
07:53 PM [astro] 500 /                                        744ms
07:53 PM [astro] 404 /favicon.ico                             0ms

Link to Minimal Reproducible Example (Optional)

No response

natemoo-re commented 3 years ago

This should be fixed by https://github.com/snowpackjs/astro/pull/1692, but feel free to reopen if you're still seeing this with the most recent @next--compiler release!

hans-d commented 3 years ago

` "astro": "^0.0.0-compiler-2021928195510"

issue still there

On Fri, Oct 29, 2021 at 5:42 AM Nate Moore @.***> wrote:

This should be fixed by #1692 https://github.com/snowpackjs/astro/pull/1692, but feel free to reopen if you're still seeing this with the most recent @next--compiler release!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/snowpackjs/astro/issues/1682#issuecomment-954405139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALI6PTHGQ2RDX6IQQM463UJIJYVANCNFSM5G3GDPNA .

hans-d commented 3 years ago

@natemoo-re as I cannot re-open, would you be so kind?

natemoo-re commented 3 years ago

Interesting... Try a fresh install of the renderers as well, just to be sure? These deps should be automatically bumped by our release script but I suspect that's where this problem is.

npm i @astrojs/renderer-{react,preact,vue,svelte}@0.0.0-compiler-202192719637
hans-d commented 3 years ago

That manual interventions seems to resolve it now indeed.

NB: bumping to the latest next--compiler (202192918241) results now in a Not Found - GET https://registry.npmjs.org/astro/-/astro-0.0.0-compiler-202192918241.tgz - Not found

hans-d commented 3 years ago

seems resolved as well with astro@next...