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

nextjs11: use with experimental.craCompat=true #219

Closed ppbl closed 1 year ago

ppbl commented 3 years ago

Is your feature request related to a problem? Please describe.

Migrate to nextjs11 through cra-to-next, and report an error withTM

info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
warn  - You have enabled experimental feature(s).
warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.

ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration[0].module.rules[1] should be one of these:
   ["..." | object { compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }, ...]
   -> A rule.
   Details:
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be an instance of RegExp.
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be a string.
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be an instance of function.
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be an object:
      object { and?, not?, or? }
      -> Logic operators used in a condition matcher.
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be an array:
      [RegExp | string | function | object { and?, not?, or? } | [(recursive), ...], ...]
      -> A list of rule conditions matching an absolute path.
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be one of these:
      RegExp | string | function | object { and?, not?, or? } | [(recursive), ...]
      -> A condition matcher matching an absolute path.
    * configuration[0].module.rules[1].oneOf[6].issuer.or[1] should be one of these:
      RegExp | string | function | object { and?, not?, or? } | [(recursive), ...]
      -> A rule condition matching an absolute path.

Describe the solution you'd like It would be great to support this model

Describe alternatives you've considered sorry, I don't have much research on this 😂

martpie commented 3 years ago

I will try to toy around with this new mode and see what I can do :)

collinmesser commented 2 years ago

I've hit this as well. I haven't figured out any work around as of yet.