NextJS prerendering error preventing deployment.

[NextJS prerender-error]
We suddently started getting errors on static pages generation in our NextJS project. Again, this prevents us from deploying anything to prod or staging. Tried updating @vicarious_swallow/loader-nextjs to 1.0.334, to no avail.

Our plasmic studio link is https://studio.plasmic.app/projects/qApMgeqj9nWLUhZtWemmnp

hi! I’m trying to reproduce this but things work with the pages in the project. I’m assuming something fancier is happening with the /fr/mag/le-film-... urls? How can I minimally reproduce rendering a url like this?

It seems to be linked to Ant Design package being imported in our project, although we do not use it

i’m not entirely sure about that though

@kindhearted_cattle I see you have upvoted this issue, have you encountered it as well ?

If you do not use it, you can just remove it from the imported projects tab… both plasmic-rich-components and antd5

@chungwu Here’s what I found from my investigation :
• The node_modules/@plasmicapp/loader-core/dist/index.js loads a bunch of libraries. Coming from your src/registry.ts file, it uses eval to execute lots of javascript.
• When loading such javascript, a library seems to not work, at least in our runtime environment: tinycolor.
• As you can see from the initial screenshot, import_chunk_V2APNOIY seems problematic. I’ve edited your loader-core/dist/index.js locally to dump this file, which is joined to this message. I do not exactly know where it comes from, and it mentions node_modules/@ctrl/tinycolor which is not included in our dependencies. I’ve tried specifying a version of tinycolor in our package.json, even downgrading it, to no avail.
• Other chunks are using this TinyColor constructor which causes the issue when prerendering our plasmic pages.
• I’ve made 100% sure that a previous version of our code that could be built cannot be built anymore, under the exact same circumstances (on vercel or locally), which makes me think that an external factor has to be the cause of our issue.
Hope this helps, tell me if you found anything with this :wink:

chunk-V2APNOIY.js

thanks; yes the tiny color dependency is coming through antd5, which is dynamically loaded in the Plasmic bundle (and so not in your local node_modules).

It would be most helpful if I could reproduce this… Could you describe how the /fr/mag/le-film... route is rendered?

Hi guys, @good_orangutan we’ve encountered unexpected codegen issues in our react app that we recently posted aswell. Given the sudden onset of these problems, I thought maybe it’s possible that both issues are linked to a specific package, that’s why I was curious and upvoted

So uhm, we decided to remove these packages from the plasmic project and the static plasmic pages generation now works again. No idea what is happening, the error message feels pretty weird. What kind of additional resources would you need to reproduce such issues ?

@good_orangutan just to know how you are using Plasmic to render /fr/mag/le-film... route that is failing the pre-rendering. It’s not one of the Pages that I see in the project?

Alright, there are several urls and I sent the wrong one.

The concerned plasmic studio url is https://studio.plasmic.app/projects/byiDMvQ3xvzxN5Ps6X7Mkc/ and the static page that could not generate is mag/le-film-du-dimanche/faster-the-story-of-breaking-2 using @plasmicapp/loader-nextjs, if and only if the antdesign/rich-components package is included in the project.