Closed dtothefp closed 2 years ago
So it's not really a bug and that's the intended behavior regarding having to specify the whole path. If your package manager nested a duplicate version of escape-string-regexp
inside a dependency's node_modules
, that probably means you have multiple versions of this library in your node_modules
.
You may want to use (for example with Yarn) the resolutions
field of your app's package.json
(be careful to not use incompatible versions though), or solve the issue with mdast-util-find-and-replace
's maintainer.
https://classic.yarnpkg.com/en/docs/selective-version-resolutions/
Hope that helps!
@martpie I agree this is bad on our end to be including multiple versions of the same package but it's a big app. is there a reason for this change because it seemed like this "just worked' in previous versions
I'm pretty sure the problem does not come from ntm but from a dependencies update you may have done recently and that provocated this duplication of this package :)
Did you happen to do that?
It's work with next-transpile-modules@^4.0, but not next-transpile-modules@^9.0 :(((
Please read the changelog :)
Please read the changelog :)
I tried, but find nothing helps me.
Please open a new issue 👍
Are you trying to transpile a local package or an npm package? NPM package. Multiple, for example
escape-string-regexp
which has non es5 compliant codeDescribe the bug Upgraded from 4.x to 8.x
@react-aria
which would compile all packages in the namespace. because@react-aria
is just a namespace and not a package got a module require error . I'm assuming this is not just the functionality so not really a bug. I wrote a function to get the paths of all modules withinnode_modules/@react-aria
and this was resolvedescape-string-regexp
than was specified in the root package.json. Therefore, we had to supply all the potential paths to this package, iemodule.exports = withTM({ webpack5: true, });
only use
escape-string-regexp
in your transpile modules config and check the output that only version one version of the lib is being compiled. the nested lib inmdast
with version^4.0.0
will remain uncompiled with es6 syntaxExpected behavior All versions of
escape-string-regexp
innode_modules
are compiledSetup
next-transpile-modules
version:npm
/yarn
version: yarn 1.22.10Additional context Add any other context about the problem here.