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

webpack SSR bundle failures with node: #206

Closed
zanedev opened this issue Apr 27, 2023 · 5 comments
Closed

webpack SSR bundle failures with node: #206

zanedev opened this issue Apr 27, 2023 · 5 comments

Comments

@zanedev
Copy link

zanedev commented Apr 27, 2023

v5.4.2 of client is throwing these errors during build for a gatsby 5.9.0 site React 18. Not sure when the issue occurs but downgrading to latest v4 (v4.0.1) and it goes away. Tried polyfilling it in webpack config but list just keeps growing.

 ERROR #98123  WEBPACK.BUILD-HTML

Generating SSR bundle failed

Reading from "node:https" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

File: node:https


 ERROR #98123  WEBPACK.BUILD-HTML

Generating SSR bundle failed

Reading from "node:http" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

File: node:http


 ERROR #98123  WEBPACK.BUILD-HTML

Generating SSR bundle failed

Reading from "node:url" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

File: node:url

@stipsan
Copy link
Member

stipsan commented Apr 27, 2023

Could you try:

{
  plugins: [
    {
      resolve: `gatsby-plugin-alias-imports`,
      options: {
        alias: {
          "node:http": "http",
        },
      }
    }
  ]
}

@zanedev
Copy link
Author

zanedev commented May 1, 2023

Didn't seem to help unfortunately, same error after installing the plugin and adding to gatsby-config plugins array.

@gorceag
Copy link

gorceag commented May 16, 2023

Didn't seem to help unfortunately, same error after installing the plugin and adding to gatsby-config plugins array.

Hey @zanedev, did you solve this in any way? I'm experiencing the same issue after upgrading Sanity.

@Hahlh
Copy link

Hahlh commented Jul 20, 2023

@zanedev Thank you very much for raising this issue here.

We were actually also experiencing this issue ("node:url" and "node:https") and were able to work around it by downgrading to @sanity/client@^v4.

Afterwards we were able to use preview-kit with createClient successfully for previews with Gatsby.

Much appreciated!

@stipsan stipsan closed this as completed in ef24109 Aug 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

🎉 This issue has been resolved in version 6.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants