Comments (5)
It looks like you're using a package manager that doesn't set up symlinks, so TS has no way to know that you have the outer monorepo setup, thus doesn't have any way to know that packages/
is where you can find a
. The easiest way is to address that is to just add a baseUrl:
"baseUrl": "../"
from typescript.
I see I forgot to specify you have to run npm install
, but I did do this in my testing. This creates symlinks.
I forgot that TypeScript doesn’t validate bare import specifiers, but it does check dynamic imports. Apart from that the difference between an import statement or an import declaration doesn’t matter. I updated the example repo to make b
export something from a
. This also makes the error appear.
This made me suspicious, because in my real world code one workspace does have this problem, but another doesn’t. It turns out enabling resolveJsonModule
in the dependant module (b
) makes the error go away, even though there are no JSON imports anywhere. I added a this option, commented, so it can be toggled easily.
baseUrl
doesn’t solve the problem, because the real world example uses scoped packages. This can be solved using paths
, but I don’t think that should be necessary.
from typescript.
Something's gone wrong here; tsc -b -f b
fails but tsc -p b
does not
from typescript.
Apparently the workaround of enabling resolveJsonModule
only works if this is enabled in the configuration file of b
directly, not if it’s enabled in a configuration it extends from.
from typescript.
Apparently the workaround of enabling resolveJsonModule only works if this is enabled in the configuration file of b directly, not if it’s enabled in a configuration it extends from.
That sounds like a bug - if you can repro it, you should report that in a separate issue.
from typescript.
Related Issues (20)
- Error: Debug Failure. False expression: Expected the specifier to be a default export HOT 1
- type assertions affect the type narrowing of the subsequent code HOT 6
- Missing interface definition for Highlight API HOT 1
- Improve new issue template selection - reorder and handle "this is crash" check better HOT 3
- Union type breaks type safety of dynamic object keys HOT 2
- Asserting changes type of original variable inline (the change reverts in subsequent lines) HOT 10
- "declare class" in a global is not visible in external files HOT 7
- Mapped type reported as incompatible when passed through another mapped type (5.4 regression) HOT 1
- Shorten error spans for missing key errors reported on object literals HOT 3
- Array prototype extensions fail circularly with `...args: T[]`, but not `args: T[]` HOT 6
- Inconsistent behaviour of es6 and esnext property initializers when using experimental property decorators HOT 3
- Spread operator doesn't remove readonly from object properties HOT 3
- Add option to throw error when `!` (NonNull expression) is used on a non-nullish expression HOT 2
- Inconsistent Type Narrowing with `never` Return Type Between Arrow and Traditional Functions HOT 2
- Class infers wrong generic parameter since e1874f3 HOT 2
- Promise returned from sync `dispose` method should not be awaited when disposing an asyc-disposable HOT 1
- Import ellision emit bug: usage of imports only in keys of interfaces does not result in those imports being elided as type-only
- `noUncheckedIndexedAccess` does not narrow properly when iterating with `for...in` HOT 4
- Omit private symbols from type HOT 6
- TS5055: Typescript includes files in "dist" folder for compilation when `rootDir` is not `./` but `./src` even after explicitly adding "dist" to `exclude` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript.