Tsparticles: Gatsby Build Error SSR

Created on 23 Jun 2020  路  4Comments  路  Source: matteobruni/tsparticles

Hiya, I've been using tsparticles in development for my Gatsby project with no problems, however when i'm building for production i get a webpack error saying

Describe the bug

"ERROR #98124 WEBPACK
Generating SSR bundle failed
an't resolve 'tsparticles'

What i've tried

Delete Node-Modules & Yarn.lock and reinstall.
Reinstall just tsparticles and react-tsparticles
updating gatsby-node to =>

exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
modules: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'src'),
'node_modules'
],
},
})
}

Was hoping maybe i've just missed something silly with gatsby but would love to some help ! Thanks

question

All 4 comments

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.77. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Hi @JonasWN,

The error you have is making me scratch my head.

Generating SSR bundle failed Can't resolve 'tsparticles'

The SSR bundle shouldn't have tsparticles or react-particles since they won't work. But if the error is reported only when building production I think it's a misconfiguration of Webpack.

Can you make a demo project on codesandbox or stackblitz to reproduce the problem? I've never used Gatsby and I don't know how to replicate the issue

Hi @matteobruni

I tried setting it up on codesandbox with just a gatsby starter and react-tsparticles and got the same build error half the time and another random one with "command failed with exit-code 137", so i'm not sure how reliable it is to you sorry :d but here's the link if it's any help

Heres the error in codesandbox

gatsby-tsParticles

I've tried using require instead of import aswell

I think you're right it's an webpack misconfig or something with it can't find the right path for some reason

I've released the 1.16.1 version, this version should fix the issue, there was a wrong path in tsParticles package.json main file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matteobruni picture matteobruni  路  4Comments

natario1 picture natario1  路  4Comments

matteobruni picture matteobruni  路  5Comments

ecrookoh picture ecrookoh  路  3Comments

BenAOlson picture BenAOlson  路  3Comments