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

Website won't run locally after build:reference #759

Closed
webermayank opened this issue Mar 28, 2025 · 6 comments
Closed

Website won't run locally after build:reference #759

webermayank opened this issue Mar 28, 2025 · 6 comments
Labels
Bug Something isn't working

Comments

@webermayank
Copy link
Contributor

Most appropriate sections of the p5.js website?

Home

What is your operating system?

Windows

Web browser and version

Chrome://latest

Actual Behavior

When we try to start website locally using npm run dev after building reference using npm run build:reference we got an error on browser

Image

the error on editor terminal is as follows:

(node:17964) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
17:20:44 [ERROR] [InvalidContentEntryFrontmatterError] reference → en/p5/arrayCopy.mdx frontmatter does not match collection schema.
deprecated: Expected type `"string"`, received "boolean"
  Hint:
    See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas.
  Error reference:
    https://docs.astro.build/en/reference/errors/invalid-content-entry-frontmatter-error/
  Stack trace:
    at C:/Users/path/to/p5.js-website/src/content/reference/en/p5/arrayCopy.mdx
    [...] See full stack trace in the browser, or rerun with --verbose.
17:20:44 [ERROR] [InvalidContentEntryFrontmatterError] reference → en/p5/arrayCopy.mdx frontmatter does not match collection schema.
deprecated: Expected type `"string"`, received "boolean"
  Hint:
    See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas.
  Error reference:
    https://docs.astro.build/en/reference/errors/invalid-content-entry-frontmatter-error/
  Stack trace:
    at C:/Users/path/to/p5.js-website/src/content/reference/en/p5/arrayCopy.mdx
    [...] See full stack trace in the browser, or rerun with --verbose.

and this is only happening after building reference.

  • after npm run custom:cleanup which deletes the reference files modification, this error won't come,

Expected Behavior

Website server would run as usual even after building reference

Steps to reproduce

Open p5.js-website in editor
run npm run build:reference and then npm run dev
go to the provided localhost link
wait for few minutes to load the wesbite

Would you like to work on the issue?

Yes

@webermayank webermayank added the Bug Something isn't working label Mar 28, 2025
@webermayank
Copy link
Contributor Author

I changed the deprecated: true to deprecated: "true" then the error shifts to another file (en/p5/shorten.mdx) instead of append.mdx

@davepagurek would me mind take a look at this, it is issue legitimate

@davepagurek
Copy link
Collaborator

I actually fixed this on this PR #737, which will get merged in a week when we release p5 2.0. In the mean time, try adding this line to your code:

deprecated: z.string().or(
z.boolean().transform(() => 'This will be removed in a future version of p5.js.')
).optional(),

@davepagurek
Copy link
Collaborator

Also, @webermayank if you wanted to make a PR to make that change now so we don't have to wait for the rest of that PR to be merged, feel free 🙂

@webermayank
Copy link
Contributor Author

Yes this seems a good idea , i,ll do it right now

@ksen0
Copy link
Member

ksen0 commented Mar 28, 2025

Thanks both!

ksen0 added a commit that referenced this issue Mar 28, 2025
fixed issue invalid Content Entry Formatter error - #759
@ksen0
Copy link
Member

ksen0 commented Mar 28, 2025

@webermayank Fix is merged, please close the issue if it's addressed fully. Thank you!

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

3 participants