martpie / next-transpile-modules

Next.js plugin to transpile code from node_modules. Please see: https://github.com/martpie/next-transpile-modules/issues/291
MIT License
1.13k stars 85 forks source link

Can't load with next-compose-plugins #254

Closed OskarD closed 2 years ago

OskarD commented 2 years ago

Edit: The problem seems to be with next-optimized-images so I will try to delete this

Are you trying to transpile a local package or an npm package? Local

Describe the bug

I can only build my project like this: module.exports = withTM(withPlugins(...

When I try the documented way, I get this error:

extension:build: TypeError: parsedPhaseConfig.substr is not a function
extension:build:     at isInCurrentPhase (/Users/oskar/code/monorepo/node_modules/.pnpm/next-compose-plugins@2.2.1/node_modules/next-compose-plugins/lib/phases.js:23:25)
extension:build:     at /Users/oskar/code/monorepo/node_modules/.pnpm/next-compose-plugins@2.2.1/node_modules/next-compose-plugins/lib/compose.js:85:41
extension:build:     at Array.forEach (<anonymous>)
extension:build:     at composePlugins (/Users/oskar/code/monorepo/node_modules/.pnpm/next-compose-plugins@2.2.1/node_modules/next-compose-plugins/lib/compose.js:77:11)
extension:build:     at /Users/oskar/code/monorepo/node_modules/.pnpm/next-compose-plugins@2.2.1/node_modules/next-compose-plugins/lib/index.js:22:38
extension:build:     at Object.normalizeConfig (/Users/oskar/code/monorepo/node_modules/.pnpm/next@12.0.3_8d19e71f537159d0e4cfe785a045975c/node_modules/next/dist/server/config-shared.js:109:18)
extension:build:     at Object.loadConfig [as default] (/Users/oskar/code/monorepo/node_modules/.pnpm/next@12.0.3_8d19e71f537159d0e4cfe785a045975c/node_modules/next/dist/server/config.js:404:47)
extension:build:     at async Span.traceAsyncFn (/Users/oskar/code/monorepo/node_modules/.pnpm/next@12.0.3_8d19e71f537159d0e4cfe785a045975c/node_modules/next/dist/trace/trace.js:74:20)
extension:build:     at async /Users/oskar/code/monorepo/node_modules/.pnpm/next@12.0.3_8d19e71f537159d0e4cfe785a045975c/node_modules/next/dist/build/index.js:87:24
extension:build:     at async Span.traceAsyncFn (/Users/oskar/code/monorepo/node_modules/.pnpm/next@12.0.3_8d19e71f537159d0e4cfe785a045975c/node_modules/next/dist/trace/trace.js:74:20)
webapp:build: info  - Checking validity of types...
extension:build:  ELIFECYCLE  Command failed with exit code 1.
extension:build: Error: command finished with error: exit status 1

To Reproduce Steps to reproduce the behavior (a reproduction is even better):

Expected behavior A clear and concise description of what you expected to happen.

Setup

Additional context Add any other context about the problem here.