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: portfolio template doesn't build with netlify edge adapter #3466

Closed
1 task
mayank99 opened this issue May 27, 2022 · 3 comments · Fixed by #3612
Closed
1 task

🐛 BUG: portfolio template doesn't build with netlify edge adapter #3466

mayank99 opened this issue May 27, 2022 · 3 comments · Fixed by #3612
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) feat: ssr Related to SSR (scope)

Comments

@mayank99
Copy link
Contributor

What version of astro are you using?

1.0.0-beta.36

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

netlify

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the Bug

After upgrading to 1.0.0-beta.33 or later, I am getting this error when running npm run build. Logs:

7:06:54 PM: $ npm run build
7:06:55 PM: > @example/[email protected] build
7:06:55 PM: > astro build
7:06:57 PM: 11:06:57 PM [warning] Warning: SSR support is still experimental and subject to API changes. If using in production pin your dependencies to prevent accidental breakage.
7:06:57 PM: 11:06:57 PM [build] Collecting build information...
7:07:02 PM: 11:07:02 PM [build] Completed in 5.50s.
7:07:02 PM: 
7:07:02 PM:  building client 
7:07:02 PM: vite v2.9.9 building for production...
7:07:02 PM: transforming...
7:07:02 PM: ✓ 3 modules transformed.
7:07:02 PM: rendering chunks...
7:07:02 PM: dist/entry.ad044289.js   8.83 KiB / gzip: 3.66 KiB
7:07:02 PM: Completed in 281ms.
7:07:02 PM: 
7:07:02 PM: 11:07:02 PM [build] Building SSR entrypoints...
7:07:05 PM: [vite:resolve] Cannot bundle Node.js built-in "path" imported from "node_modules/vfile/lib/minpath.js". Consider disabling ssr.noExternal or remove the built-in dependency.
7:07:05 PM:  error   Cannot bundle Node.js built-in "path" imported from "node_modules/vfile/lib/minpath.js". Consider disabling ssr.noExternal or remove the built-in dependency.
7:07:05 PM:     at error (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:198:30)
7:07:05 PM:     at throwPluginError (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:22091:12)
7:07:05 PM:     at Object.error (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:22814:20)
7:07:05 PM:     at Object.resolveId (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40286:34)
7:07:05 PM:     at Object.<anonymous> (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:41551:19)
7:07:05 PM:     at /opt/build/repo/node_modules/rollup/dist/shared/rollup.js:23023:37
7:07:05 PM: ​
7:07:05 PM: ────────────────────────────────────────────────────────────────
7:07:05 PM:   "build.command" failed                                        

Downgrading to 1.0.0-beta.31 makes it work again.

Link to Minimal Reproducible Example

https://github.com/mayank99/astro-netlify-edge/tree/1.0.0-beta.36

Participation

  • I am willing to submit a pull request for this issue.
@aFuzzyBear aFuzzyBear added the feat: ssr Related to SSR (scope) label May 30, 2022
@natemoo-re natemoo-re added - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) s1-small labels Jun 2, 2022
@bholmesdev bholmesdev removed their assignment Jun 6, 2022
@mayank99
Copy link
Contributor Author

mayank99 commented Jun 7, 2022

I'm still getting the same issue after updating to 1.0.0-beta.42.

Logs with no changes
4:09:47 PM: vite v2.9.10 building for production...
4:09:47 PM: transforming...
4:09:47 PM: ✓ 3 modules transformed.
4:09:47 PM: rendering chunks...
4:09:47 PM: dist/entry.ad044289.js   8.83 KiB / gzip: 3.66 KiB
4:09:47 PM: Completed in 240ms.
4:09:47 PM: 
4:09:47 PM: 08:09:47 PM [build] Building SSR entrypoints...
4:09:49 PM: [vite:resolve] Cannot bundle Node.js built-in "path" imported from "node_modules/vfile/lib/minpath.js". Consider disabling ssr.noExternal or remove the built-in dependency.
4:09:49 PM:  error   Cannot bundle Node.js built-in "path" imported from "node_modules/vfile/lib/minpath.js". Consider disabling ssr.noExternal or remove the built-in dependency.
4:09:49 PM:     at error (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:198:30)
4:09:49 PM:     at throwPluginError (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:21936:12)
4:09:49 PM:     at Object.error (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:22659:20)
4:09:49 PM:     at Object.resolveId (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:40569:34)
4:09:49 PM:     at Object.<anonymous> (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:41834:19)
4:09:49 PM:     at /opt/build/repo/node_modules/rollup/dist/shared/rollup.js:22868:37
Logs with vite.ssr.noExternal=true
4:31:55 PM: > astro build
4:31:57 PM: 08:31:57 PM [warning] Warning: SSR support is still experimental and subject to API changes. If using in production pin your dependencies to prevent accidental breakage.
4:31:57 PM: 08:31:57 PM [build] Collecting build information...
4:32:01 PM: 8:32:01 PM [vite] Error when evaluating SSR module /node_modules/serialize-javascript/index.js?v=74dde218:
4:32:01 PM: ReferenceError: require is not defined
4:32:01 PM:     at /node_modules/serialize-javascript/index.js?v=74dde218:9:19
4:32:01 PM:     at instantiateModule (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:50279:15)
4:32:01 PM: 8:32:01 PM [vite] Error when evaluating SSR module /node_modules/astro/dist/runtime/server/hydration.js:
4:32:01 PM: ReferenceError: require is not defined
4:32:01 PM:     at /node_modules/serialize-javascript/index.js?v=74dde218:7:13
4:32:01 PM:     at instantiateModule (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:50279:15)
4:32:01 PM: 8:32:01 PM [vite] Error when evaluating SSR module /node_modules/astro/dist/runtime/server/index.js:
4:32:01 PM: ReferenceError: require is not defined
4:32:01 PM:     at /node_modules/serialize-javascript/index.js?v=74dde218:5:2
4:32:01 PM:     at instantiateModule (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:50279:15)
4:32:01 PM: 8:32:01 PM [vite] Error when evaluating SSR module /opt/build/repo/src/pages/index.astro:
4:32:01 PM: ReferenceError: require is not defined
4:32:01 PM:     at /node_modules/serialize-javascript/index.js?v=74dde218:3:2
4:32:01 PM:     at instantiateModule (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:50279:15)
4:32:01 PM:  error   require is not defined
4:32:01 PM:     at /node_modules/serialize-javascript/index.js?v=74dde218:1:2
4:32:01 PM:     at instantiateModule (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:50279:15)
Logs with vite.ssr.noExternal=false
4:33:26 PM: > astro build
4:33:27 PM: 08:33:27 PM [warning] Warning: SSR support is still experimental and subject to API changes. If using in production pin your dependencies to prevent accidental breakage.
4:33:27 PM: 08:33:27 PM [build] Collecting build information...
4:33:28 PM:  error   filename.split is not a function
4:33:28 PM:     at normalizePath (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:2417:21)
4:33:28 PM:     at getMatcherString$1 (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:2422:16)
4:33:28 PM:     at Object.test (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:2441:33)
4:33:28 PM:     at result (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:2457:25)
4:33:28 PM:     at Array.filter (<anonymous>)
4:33:28 PM:     at resolveSSRExternal (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:41111:31)
4:33:28 PM:     at Object.ssrLoadModule (/opt/build/repo/node_modules/vite/dist/node/chunks/dep-9e5491c9.js:60124:40)
4:33:28 PM:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
4:33:28 PM:     at async loadRenderer (file:///opt/build/repo/node_modules/astro/dist/core/render/dev/index.js:32:15)
4:33:28 PM:     at async Promise.all (index 0)

@mayank99 mayank99 changed the title 🐛 BUG: portfolio template doesn't build with SSR adapter on 1.0.0-beta.36 🐛 BUG: portfolio template doesn't build with netlify SSR adapter Jun 7, 2022
@nickytonline
Copy link

Thanks for raising the issue @mayank99! I've added it to our project board.

@bholmesdev bholmesdev self-assigned this Jun 15, 2022
@bholmesdev bholmesdev changed the title 🐛 BUG: portfolio template doesn't build with netlify SSR adapter 🐛 BUG: portfolio template doesn't build with netlify edge adapter Jun 15, 2022
@bholmesdev
Copy link
Contributor

Note: this issue is edge-specific. Updated issue title to reflect that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) feat: ssr Related to SSR (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants