Like what we’re doing? Star us on GitHub!

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

Stupidism
4 months ago
1 3

Bug Report

image

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

  • Stupidism
    4 months ago

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

  • denolfe
    Payload Team
    4 months ago

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

  • jmikrut
    Payload Team
    4 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
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More