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

Ensure code generated by create-puck-app can be built #48

Closed
chrisvxd opened this issue Sep 6, 2023 · 1 comment · Fixed by #70
Closed

Ensure code generated by create-puck-app can be built #48

chrisvxd opened this issue Sep 6, 2023 · 1 comment · Fixed by #70

Comments

@chrisvxd
Copy link
Member

chrisvxd commented Sep 6, 2023

The code generated by the generator doesn't get built on publish, which makes it easy to publish code that will fail when the user tries to build it. We should build all recipes as generated by the generator as part of a GitHub workflow for PRs, failing if any build fails.

To test generators, we need to:

Example: #46

@chrisvxd chrisvxd changed the title Add build tests for generator Ensure code generated by create-puck-app can be built Sep 10, 2023
@chrisvxd
Copy link
Member Author

@abhishek276533 following on from #59, I can reproduce on a clean-clone. It's possible something was getting cached.

I'll investigate and report back.

yarn run v1.22.19
$ next build
- info Creating an optimized production build
- info Compiled successfully
- info Linting and checking validity of types
- info Collecting page data
[    ] - info Generating static pages (0/4)TypeError: Cannot read properties of null (reading 'root')
    at Module.generateMetadata (/Users/chrisvilla/Projects/tmp/puck/recipes/next/.next/server/chunks/801.js:175:29)
    at /Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/lib/metadata/resolve-metadata.js:199:24
    at /Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/server/lib/trace/tracer.js:117:36
    at NoopContextManager.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)
    at ContextAPI.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)
    at NoopTracer.startActiveSpan (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)
    at ProxyTracer.startActiveSpan (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)
    at /Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/server/lib/trace/tracer.js:106:107
    at NoopContextManager.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)
    at ContextAPI.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'root')
    at Module.generateMetadata (/Users/chrisvilla/Projects/tmp/puck/recipes/next/.next/server/chunks/801.js:175:29)
    at /Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/lib/metadata/resolve-metadata.js:199:24
    at /Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/server/lib/trace/tracer.js:117:36
    at NoopContextManager.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)
    at ContextAPI.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)
    at NoopTracer.startActiveSpan (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)
    at ProxyTracer.startActiveSpan (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)
    at /Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/server/lib/trace/tracer.js:106:107
    at NoopContextManager.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)
    at ContextAPI.with (/Users/chrisvilla/Projects/tmp/puck/recipes/next/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)
- info Generating static pages (4/4)

> Export encountered errors on following paths:
	/page: /
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant