ERROR in ./dist/apps/seo-payload/config.js Module build failed (from ./node_modules/swc-loader/src/index.js): Error: unknown field `presets` at line 1 column 400

default discord avatar
Stupidism
7 months ago
1 1

I got this error after I fixed the version conflict issue of graphql. Now, after hacking the require.cache of graphql, I can confirm this is another issue. I'm not very familiar with swc-loader. Can anybody help me take a look?

ERROR in ./dist/apps/seo-payload/config.js
Module build failed (from ./node_modules/swc-loader/src/index.js):
Error: unknown field `presets` at line 1 column 400

Repro steps:

https://github.com/Stupidism/nx-payload-demo.

git clone git@github.com:Stupidism/nx-payload-demo.git
PUPPETEER_SKIP_DOWNLOAD=1 CYPRESS_INSTALL_BINARY=0 npm install
nx run seo-payload:serve
  • default discord avatar
    Stupidism
    6 months ago

    Figured it out myself.
    I overrided the babel loader config before. Now it applies to swc-loader. Removing them fixed for me.

    image

Open the post
Continue the discussion in GitHub
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.