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

SSG in Next 9.3 #4

Closed
goodok21 opened this issue Mar 31, 2020 · 2 comments
Closed

SSG in Next 9.3 #4

goodok21 opened this issue Mar 31, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@goodok21
Copy link

Hey! When I'm trying to run yarn export, got error:

> using build directory: /Users/user/Git/project/.next
  copying "static build" directory
> No "exportPathMap" found in "next.config.js". Generating map from "./pages"
> Info: Loaded env from .env
  launching 3 workers
  copying "public" directory
[ ===] Exporting (0/7)(node:4321) UnhandledPromiseRejectionWarning: TypeError: value.replace is not a function
at trim (/Users/user/Git/project/node_modules/http-link-header/lib/link.js:17:16)
    at Link.parse (/Users/user/Git/project/node_modules/http-link-header/lib/link.js:120:13)
    at new Link (/Users/user/Git/project/node_modules/http-link-header/lib/link.js:49:12)
    at /Users/user/Git/project/node_modules/next-graphql-react/universal/withGraphQLApp.js:117:42
(node:4321) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4321) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

it's stuck in Exporting. Can anybody share example?

@jaydenseric jaydenseric added the bug Something isn't working label Mar 31, 2020
@jaydenseric
Copy link
Owner

jaydenseric commented Mar 31, 2020

I think it's because when Next.js does a static HTML export there is no server running, and the req and res in getInitialProps context is missing:

https://github.com/jaydenseric/next-graphql-react/blob/v6.0.1/src/universal/withGraphQLApp.mjs#L139

Probably the code should first check if res exists in the context before attempting to read from it.

I might be able to get some time in the next few days to add support for static HTML export, we'll see :)

@jaydenseric
Copy link
Owner

Thanks for your patience, the fix has been published 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants