Closed vwong closed 12 months ago
@vwong can you npm ls @marko/compiler
?
With older versions of @marko/type-check
and marko
├─┬ @marko/run@0.2.0
│ └─┬ @marko/vite@2.4.8
│ └── @marko/compiler@5.31.2 deduped
├─┬ @marko/type-check@0.0.16
│ └─┬ @marko/language-tools@2.1.2
│ └── @marko/compiler@5.31.2 deduped
├─┬ marko@5.29.1
│ ├── @marko/compiler@5.31.2
│ └─┬ @marko/translator-default@5.29.2
│ └── @marko/compiler@5.31.2 deduped
└─┬ prettier-plugin-marko@2.0.1
└── @marko/compiler@5.31.2 deduped
With latest version of @marko/type-check
and marko
, (and everything else at NPM latest)
├─┬ @marko/run@0.2.0
│ └─┬ @marko/vite@2.4.8
│ └── @marko/compiler@5.31.2 deduped
├─┬ @marko/type-check@0.0.16
│ └─┬ @marko/language-tools@2.1.2
│ └── @marko/compiler@5.31.2 deduped
├─┬ marko@5.29.2
│ ├── @marko/compiler@5.31.2
│ └─┬ @marko/translator-default@5.29.2
│ └── @marko/compiler@5.31.2 deduped
└─┬ prettier-plugin-marko@2.0.1
└── @marko/compiler@5.31.2 deduped
Both give the same error.
@vwong does adding @marko/compiler as a devDependency resolve the issue? It should (part of the issue here is that most of these packages have the compiler as a "peerDendency"). The type-check package incorrectly had it as a direct dep causing invalid duplication.
Nope, that didn't work. Same deal as before.
@vwong could you try @marko/type-check@0.0.17
? I suspect it will give a different error.
Different error, alright
> mtc
node:internal/modules/cjs/loader:1042
throw err;
^
Error: Cannot find module 'marko/package.json'
Require stack:
-
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Function.resolve (node:internal/modules/cjs/helpers:109:19)
at loadMeta (/node_modules/@marko/language-tools/dist/index.js:3097:47)
at getMeta (/node_modules/@marko/language-tools/dist/index.js:3086:10)
at getConfig (/node_modules/@marko/language-tools/dist/index.js:2950:10)
at getTypeLibs (/node_modules/@marko/language-tools/dist/index.js:2957:18)
at Object.create (/node_modules/@marko/language-tools/dist/index.js:3180:26)
at Object.create (/node_modules/@marko/language-tools/dist/index.js:3334:46)
at createCompilerHost (/node_modules/@marko/type-check/dist/cli.js:337:55)
at run (/node_modules/@marko/type-check/dist/cli.js:81:53) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '' ]
}
Node.js v18.13.0
This is with all the latest packages from npm right now. Ignoring transitive dependencies, this is what I tried installing in package.json
"@marko/run": "^0.2.0",
"@marko/testing-library": "^6.1.4",
"@marko/type-check": "^0.0.17",
"marko": "^5.29.2",
"prettier-plugin-marko": "^2.0.1",
@marko/language-tools@2.1.1
└─┬ @marko/type-check@0.0.15 └── @marko/language-tools@2.1.1
Details
A recent upgrade to
@marko/language-tools
broke@marko/type-check
.I was using
@marko/type-check@0.0.15
and only upgraded transitive dependencies in mypackage-lock.json
and the below error started to occur. Upgrading all of my@marko/*
packages, including to@marko/type-check@0.0.16
did not help.Expected Behavior
mtc
to type-check my Marko files.Actual Behavior
mtc
crashed with the following error message.Your Environment
Node.js v18.13.0 MacOS 13.4.1