Open Sinled opened 3 years ago
(typescript) Error: /Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib/src/index.tsx(7,10): semantic error TS2305: Module '"../node_modules/office-ui-fabric-react/lib/Styling"' has no exported member 'mergeStyleSets'. Error: /Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib/src/index.tsx(7,10): semantic error TS2305: Module '"../node_modules/office-ui-fabric-react/lib/Styling"' has no exported member 'mergeStyleSets'.
So OUFR has had errors before: #461
I'm not really sure how rush
works but if it's lifting OUFR to top-level, you might need to alter your include
or typeRoots
to also read the top-level typings.
if i use
tsc
- instead of tsdx - it builds fine
I'm not sure why tsc
works though 🤔 Is that the same way you're running tsdx build
?
I do see you're using TS v4 for tsc
while tsdx
is still on TS v3 (see #926 for details and workaround there)
Your environment
Seems like the command may have ran in the wrong directory since tsdx
and typescript
versions are not shown.
@agilgur5 thanks for reply,
i've normalized versions of typescript (explcitly specified 3.9.7 which is used when running tsdx), and tried to run from the same folder
sinled in ~/dev/Projects/_my/_tmp/test-rushx-tsdx (master●●)
$ cd packages/somelib
sinled in ~/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib (master●●)
$ ./node_modules/.bin/tsc --noEmit false
sinled in ~/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib (master●●)
$ ./node_modules/.bin/tsc -v
Version 3.9.7
sinled at SD-MacBook-Pro in ~/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib (master●●)
$ ./node_modules/.bin/tsdx build
✓ Creating entry file 979 ms
(typescript) Error: /Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib/src/index.tsx(7,10): semantic error TS2305: Module '"../node_modules/office-ui-fabric-react/lib/Styling"' has no exported member 'mergeStyleSets'.
Error: /Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/packages/somelib/src/index.tsx(7,10): semantic error TS2305: Module '"../node_modules/office-ui-fabric-react/lib/Styling"' has no exported member 'mergeStyleSets'.
at error (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup/1.32.1/node_modules/rollup/dist/shared/node-entry.js:5400:30)
at throwPluginError (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup/1.32.1/node_modules/rollup/dist/shared/node-entry.js:11878:12)
at Object.error (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup/1.32.1/node_modules/rollup/dist/shared/node-entry.js:12912:24)
at Object.error (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup/1.32.1/node_modules/rollup/dist/shared/node-entry.js:12081:38)
at RollupContext.error (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup-plugin-typescript2/0.27.3_rollup@1.32.1+typescript@3.9.7/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:17237:30)
at /Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup-plugin-typescript2/0.27.3_rollup@1.32.1+typescript@3.9.7/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:25033:23
at arrayEach (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup-plugin-typescript2/0.27.3_rollup@1.32.1+typescript@3.9.7/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:545:11)
at Function.forEach (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup-plugin-typescript2/0.27.3_rollup@1.32.1+typescript@3.9.7/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9397:14)
at printDiagnostics (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup-plugin-typescript2/0.27.3_rollup@1.32.1+typescript@3.9.7/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:25006:12)
at Object.transform (/Users/sinled/dev/Projects/_my/_tmp/test-rushx-tsdx/common/temp/node_modules/.pnpm/registry.npmjs.org/rollup-plugin-typescript2/0.27.3_rollup@1.32.1+typescript@3.9.7/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29277:17)
I'm not really sure how rush works but if it's lifting OUFR to top-level, you might need to alter your include or typeRoots to also read the top-level typings.
AFAIK rush
hardlinks all dependencies directly to the specific package node_modules
If anyone stumbled upon this,
i've found partial workaround - typecheck with tsc
and build with tsdx
"build": "tsc && tsdx build --transpileOnly"
I am having the same issue with material-ui
I am having the same issue with material-ui
also use rushjs?
I am having the same issue with material-ui
also use rushjs?
Yes I do!
For reference, I am fairly sure I fixed this upstream in https://github.com/ezolenko/rollup-plugin-typescript2/pull/332, which fixed https://github.com/ezolenko/rollup-plugin-typescript2/issues/234, which is a very similar upstream issue with pnpm
symlinks.
To use that in your project, you can set your pnpm
overrides
to use rollup-plugin-typescript2
0.32.0+:
{
"pnpm": {
"overrides": {
"rollup-plugin-typescript2": "^0.32.0"
}
}
}
Current Behavior
tsdx build
fails inside rush monorepo, when importing third party types and modulesExpected behavior
build success
Suggested solution(s)
i don't know
Additional context
here is reproduction repo https://github.com/Sinled/test-rushx-tsdx (but it needs rush)
i am not sure if this is
tsdx
orrush
problem, on the one hand, if i usetsc
- instead of tsdx - it builds finebut on the other - if i install dependencies directly inside package - tsdx also builds ok
Your environment
Any ideas how this can be solved?