Cannot find module '@babel/preset-typescript' from '/serverless'

default discord avatar
10 months ago
1 3

Bug Report


index.js:10 Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '@babel/preset-typescript' from '/serverless'

Current Behavior

Expected Behavior

Possible Solution

Steps to Reproduce

Detailed Description

  • default discord avatar
    10 months ago

    I solved it by upgrading @babel/core and @babel/preset-typescript in my dependencies

  • discord user avatar
    Payload Team
    10 months ago

    Could you please fill out the rest of the bug template? This isn't enough information for us to look into.

  • discord user avatar
    Payload Team
    10 months ago

    Hey @Stupidism — it looks like this preset is somehow working its way into your client-side JS bundle, which should not happen. You would never want @babel/preset-typescript in your admin bundle. So take a peek through your code and try and find where you are bringing in server-side code, then use Webpack aliases to fix.

    Does that make sense? Gonna convert this to a discussion for now!

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


Connect with the Payload Community on Discord



Can't find what you're looking for?

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