-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regression since v0.17.0 on docxtemplater : β node16 (from ESM) β π΅οΈ Named exports β #222
Comments
I'm getting the same issue on a project that passed with an older version. is there a possibility that one of the issues is when the only export from a CJS module is a constructor - whether it has quasi "named exports" or not - that it's picking up |
This seems to happen since v0.16.1 |
I investigated this a bit last week and discovered that itβs actually a TypeScript bug (the same root cause makes |
@andrewbranch my "missing" lists include more than just |
I donβt think cjs-module-lexer can recognize that though (i.e., those properties would not be available as named imports from an ESM file), so that sounds like the rule is working. |
@andrewbranch fwiw, i've got another package with this error, but
which makes sense, because it's a CJS module. i'm using is there a different tsconfig i need to make this work? |
@ljharb what package is that? Iβll take a look |
<3 https://github.com/ljharb/internal-slot - clone and remove |
The error is basically working as intended; itβs just showing a weak point of TS itself here. It looks to TS like
Thereβs no way to tell TS not to treat the properties of an |
If node is able to figure it out with cjs-module-lexer, why can't attw or TS? |
Node isnβt able to figure it out with cjs-module-lexer; thatβs what I showed with the terminal snippet above. Tried again with 23.4.0 and got the same result. |
It's not supposed to figure it out - it's not a module with 4 named exports, it's a single object that has 4 methods. node correctly figures out that it's only default-importable, attw is confused and thinks there should be named exports. |
attw is not confused. attw is telling you that TypeScript is going to interpret those 4 methods as named exports, and Node.js is not. attw doesnβt claim which interpretation is better, itβs just telling you thereβs a disagreement. |
ah ok, gotcha. so is there a config option that can make TS match node? |
Nope. I would love to say that |
It's fine if the default stays what it is - but would it be reasonable to add a config option to TS for this? |
I donβt think so, because the it should be enabled under |
that's unfortunate; seems like i'll just have to live with disabling this attw rule in repos where this applies. |
Got another one - a module that exports an array is reporting "missing": [
"0",
"1",
"2",
"length"
] Code: module.exports = require('safe-array-concat')(
'hasIndices' in re ? 'd' : [],
'g',
'i',
'm',
'dotAll' in re ? 's' : [],
'unicode' in re ? 'u' : [],
'unicodeSets' in re ? 'v' : [],
'sticky' in re ? 'y' : []
); iow, it's statically (incorrectly) reading that array as having only 3 items, when it has anywhere from 3 to 8, and it's reporting the own properties of that array as exports, even |
Thereβs a condition in TS itself that avoids treating the members of array or tuple types as exports, but this function is primarily used by the language service, and so for performance reasons, it doesnβt resolve any unions or intersections to find out if a type is ultimately array- or tuple-like. What you actually have here is a union of 32 tuple types (25 because of the 5 conditional expressions) π I can add the |
That'd be great :-D thanks! I assume attw isn't very perf-sensitive since it's a CI-time, not a dev-time, check? |
This is fixed in #233, but |
Thanks! I'll take it :-) |
Hello,
I was using version 0.15.4 without any issues now, but since upgrading to 0.17.0, I get a new issue.
This seems that this is a feature added here : https://github.com/arethetypeswrong/arethetypeswrong.github.io/pull/166/files
Here's the output I get with :
Full JSON
{ "analysis": { "packageName": "docxtemplater", "packageVersion": "3.52.0", "types": { "kind": "included" }, "buildTools": { "@arethetypeswrong/cli": "^0.17.0", "webpack": "^5.96.1" }, "entrypoints": { ".": { "subpath": ".", "resolutions": { "node10": { "name": ".", "resolutionKind": "node10", "resolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.d.ts", "isJson": false, "isTypeScript": true, "trace": [ "======== Resolving module 'docxtemplater' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/docxtemplater/package.json'.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater.d.ts' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field './js/docxtemplater.d.ts' that references '/node_modules/docxtemplater/js/docxtemplater.d.ts'.", "File '/node_modules/docxtemplater/js/docxtemplater.d.ts' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.d.ts' with Package ID 'docxtemplater/js/docxtemplater.d.ts@3.52.0'. ========" ] }, "implementationResolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.js", "isJson": false, "isTypeScript": false, "trace": [ "======== Resolving module 'docxtemplater' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "Found 'package.json' at '/node_modules/docxtemplater/package.json'.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: JavaScript, JSON.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "File '/node_modules/docxtemplater.js' does not exist.", "File '/node_modules/docxtemplater.jsx' does not exist.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.js' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.js' with Package ID 'docxtemplater/js/docxtemplater.js@3.52.0'. ========" ] }, "files": [ "/node_modules/typescript/lib/lib.d.ts", "/node_modules/docxtemplater/js/docxtemplater.d.ts" ], "visibleProblems": [] }, "node16-cjs": { "name": ".", "resolutionKind": "node16-cjs", "resolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.d.ts", "isJson": false, "isTypeScript": true, "trace": [ "======== Resolving module 'docxtemplater' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Node16'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/docxtemplater/package.json'.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater.d.ts' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field './js/docxtemplater.d.ts' that references '/node_modules/docxtemplater/js/docxtemplater.d.ts'.", "File '/node_modules/docxtemplater/js/docxtemplater.d.ts' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.d.ts' with Package ID 'docxtemplater/js/docxtemplater.d.ts@3.52.0'. ========" ] }, "implementationResolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.js", "isJson": false, "isTypeScript": false, "trace": [ "======== Resolving module 'docxtemplater' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Node16'.", "Resolving in CJS mode with conditions 'require', 'node'.", "File '/package.json' does not exist.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, JavaScript, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "Found 'package.json' at '/node_modules/docxtemplater/package.json'.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "File '/node_modules/docxtemplater.js' does not exist.", "File '/node_modules/docxtemplater.jsx' does not exist.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.js' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.js' with Package ID 'docxtemplater/js/docxtemplater.js@3.52.0'. ========" ] }, "files": [ "/node_modules/typescript/lib/lib.d.ts", "/node_modules/docxtemplater/js/docxtemplater.d.ts" ], "visibleProblems": [] }, "node16-esm": { "name": ".", "resolutionKind": "node16-esm", "resolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.d.ts", "isJson": false, "isTypeScript": true, "trace": [ "======== Resolving module 'docxtemplater' from '/index.mts'. ========", "Explicitly specified module resolution kind: 'Node16'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field './js/docxtemplater.d.ts' that references '/node_modules/docxtemplater/js/docxtemplater.d.ts'.", "File '/node_modules/docxtemplater/js/docxtemplater.d.ts' exists - use it as a name resolution result.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.d.ts' with Package ID 'docxtemplater/js/docxtemplater.d.ts@3.52.0'. ========" ] }, "implementationResolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.js", "isJson": false, "isTypeScript": false, "trace": [ "======== Resolving module 'docxtemplater' from '/index.mts'. ========", "Explicitly specified module resolution kind: 'Node16'.", "Resolving in ESM mode with conditions 'import', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, JavaScript, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File name '/node_modules/docxtemplater/index.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.js' exists - use it as a name resolution result.", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update.", "File '/package.json' does not exist according to earlier cached lookups.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File name '/node_modules/docxtemplater/index.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.js' with Package ID 'docxtemplater/js/docxtemplater.js@3.52.0'. ========" ] }, "files": [ "/node_modules/typescript/lib/lib.d.ts", "/node_modules/docxtemplater/js/docxtemplater.d.ts" ], "visibleProblems": [ 0 ] }, "bundler": { "name": ".", "resolutionKind": "bundler", "resolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.d.ts", "isJson": false, "isTypeScript": true, "trace": [ "======== Resolving module 'docxtemplater' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Bundler'.", "Resolving in CJS mode with conditions 'import', 'types'.", "File '/package.json' does not exist.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/docxtemplater/package.json'.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater.d.ts' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field './js/docxtemplater.d.ts' that references '/node_modules/docxtemplater/js/docxtemplater.d.ts'.", "File '/node_modules/docxtemplater/js/docxtemplater.d.ts' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.d.ts' with Package ID 'docxtemplater/js/docxtemplater.d.ts@3.52.0'. ========" ] }, "implementationResolution": { "fileName": "/node_modules/docxtemplater/js/docxtemplater.js", "isJson": false, "isTypeScript": false, "trace": [ "======== Resolving module 'docxtemplater' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Bundler'.", "Resolving in CJS mode with conditions 'import'.", "File '/package.json' does not exist.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript, JavaScript, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "Found 'package.json' at '/node_modules/docxtemplater/package.json'.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "File '/node_modules/docxtemplater.js' does not exist.", "File '/node_modules/docxtemplater.jsx' does not exist.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.js' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update.", "File '/package.json' does not exist according to earlier cached lookups.", "Loading module 'docxtemplater' from 'node_modules' folder, target file types: TypeScript.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript.", "File '/node_modules/docxtemplater/package.json' exists according to earlier cached lookups.", "File '/node_modules/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater.tsx' does not exist.", "'package.json' has 'main' field 'js/docxtemplater.js' that references '/node_modules/docxtemplater/js/docxtemplater.js'.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/docxtemplater/js/docxtemplater.js', target file types: TypeScript.", "File name '/node_modules/docxtemplater/js/docxtemplater.js' has a '.js' extension - stripping it.", "File '/node_modules/docxtemplater/js/docxtemplater.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.tsx' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.ts' does not exist.", "File '/node_modules/docxtemplater/js/docxtemplater.js.tsx' does not exist.", "Directory '/node_modules/docxtemplater/js/docxtemplater.js' does not exist, skipping all lookups in it.", "File '/node_modules/docxtemplater/index.ts' does not exist.", "File '/node_modules/docxtemplater/index.tsx' does not exist.", "======== Module name 'docxtemplater' was successfully resolved to '/node_modules/docxtemplater/js/docxtemplater.js' with Package ID 'docxtemplater/js/docxtemplater.js@3.52.0'. ========" ] }, "files": [ "/node_modules/typescript/lib/lib.d.ts", "/node_modules/docxtemplater/js/docxtemplater.d.ts" ], "visibleProblems": [] } }, "hasTypes": true, "isWildcard": false } }, "programInfo": { "node10": {}, "node16": { "moduleKinds": { "/node_modules/typescript/lib/lib.d.ts": { "detectedKind": 1, "detectedReason": "no:type", "reasonFileName": "/node_modules/typescript/lib/lib.d.ts" }, "/node_modules/docxtemplater/js/docxtemplater.d.ts": { "detectedKind": 1, "detectedReason": "no:type", "reasonFileName": "/node_modules/docxtemplater/package.json" }, "/node_modules/docxtemplater/js/docxtemplater.js": { "detectedKind": 1, "detectedReason": "no:type", "reasonFileName": "/node_modules/docxtemplater/package.json" } } }, "bundler": {} }, "problems": [ { "kind": "NamedExports", "implementationFileName": "/node_modules/docxtemplater/js/docxtemplater.js", "typesFileName": "/node_modules/docxtemplater/js/docxtemplater.d.ts", "isMissingAllNamed": false, "missing": [ "prototype", "prototype" ] } ] }, "problems": { "NamedExports": [ { "kind": "NamedExports", "implementationFileName": "/node_modules/docxtemplater/js/docxtemplater.js", "typesFileName": "/node_modules/docxtemplater/js/docxtemplater.d.ts", "isMissingAllNamed": false, "missing": [ "prototype", "prototype" ] } ] } }(The full JSON is shown above, but here is the bit that I think is relevant :
However to be honest, I don't see what is wrong with that.
You can reproduce this with following code :
The text was updated successfully, but these errors were encountered: