typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
110 stars 51 forks source link

`Cannot find module '@glimmer/env'` when trying to run `glint --declaration` #698

Open NullVoxPopuli opened 9 months ago

NullVoxPopuli commented 9 months ago
❯ pnpm glint --declaration
node:internal/modules/cjs/loader:1144
  const err = new Error(message);
              ^

Error: Cannot find module '@glimmer/env'
Require stack:
- <repo>/node_modules/.pnpm/@glimmer+syntax@0.84.3/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/source/source.js
- <repo>/node_modules/.pnpm/@glimmer+syntax@0.84.3/node_modules/@glimmer/syntax/dist/commonjs/es2017/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (<repo>/node_modules/.pnpm/@glimmer+syntax@0.84.3/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/source/source.js:8:12)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '<repo>/node_modules/.pnpm/@glimmer+syntax@0.84.3/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/source/source.js',
    '<repo>/node_modules/.pnpm/@glimmer+syntax@0.84.3/node_modules/@glimmer/syntax/dist/commonjs/es2017/index.js'
  ]
}
why @glimmer/syntax ``` Legend: production dependency, optional only, dev only limber-ui@1.0.0-beta.0 /home/nvp/Development/NullVoxPopuli/limber/packages/app-support/limber-ui/addon dependencies: @fortawesome/ember-fontawesome 2.0.0 ├─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 ├─┬ ember-cli-htmlbars 6.3.0 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 devDependencies: @embroider/addon-dev 4.2.0 └─┬ @embroider/core 3.4.4 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 @glint/core 1.3.0 └── @glimmer/syntax 0.84.3 @glint/environment-ember-loose 1.3.0 ├─┬ ember-cli-htmlbars 6.3.0 peer │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-modifier 4.1.0 peer └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 @glint/environment-ember-template-imports 1.3.0 └─┬ @glint/environment-ember-loose 1.3.0 peer ├─┬ ember-cli-htmlbars 6.3.0 peer │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-modifier 4.1.0 peer └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 @nullvoxpopuli/eslint-configs 3.2.2 ├─┬ eslint-plugin-ember 12.0.0 peer │ └─┬ ember-eslint-parser 0.2.5 │ └── @glimmer/syntax 0.85.13 └─┬ prettier-plugin-ember-template-tag 1.1.0 ├── @glimmer/syntax 0.84.3 └─┬ ember-cli-htmlbars 6.3.0 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-async-data 1.0.3 └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-cli-htmlbars 6.3.0 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-modifier 4.1.0 └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-primitives 0.10.4 ├─┬ ember-element-helper 0.8.5 │ ├─┬ @embroider/util 1.12.1 │ │ ├─┬ @glint/environment-ember-loose 1.3.0 peer │ │ │ ├─┬ ember-cli-htmlbars 6.3.0 peer │ │ │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ │ └── @glimmer/syntax 0.84.3 │ │ │ └─┬ ember-modifier 4.1.0 peer │ │ │ └─┬ ember-source 5.6.0 peer │ │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ │ └── @glimmer/syntax 0.85.13 │ │ │ ├── @glimmer/syntax 0.85.13 │ │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ │ └── @glimmer/syntax 0.84.3 │ │ │ └─┬ ember-auto-import 2.7.2 │ │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 ├─┬ ember-modifier 4.1.0 peer │ └─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 ├─┬ ember-resources 6.5.1 peer │ ├─┬ ember-async-data 1.0.3 │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 ├─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 ├─┬ ember-velcro 2.1.3 │ ├─┬ ember-functions-as-helper-polyfill 2.1.2 │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ ├─┬ ember-modifier 4.1.0 peer │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 ├─┬ reactiveweb 1.2.0 │ ├─┬ ember-async-data 1.0.3 │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ ├─┬ ember-cached-decorator-polyfill 1.0.2 │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ ├─┬ ember-resources 6.5.1 │ │ ├─┬ ember-async-data 1.0.3 │ │ │ └─┬ ember-source 5.6.0 peer │ │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ │ └── @glimmer/syntax 0.85.13 │ │ │ ├── @glimmer/syntax 0.85.13 │ │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ │ └── @glimmer/syntax 0.84.3 │ │ │ └─┬ ember-auto-import 2.7.2 │ │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-source 5.6.0 peer │ │ ├─┬ @glimmer/compiler 0.85.13 │ │ │ └── @glimmer/syntax 0.85.13 │ │ ├── @glimmer/syntax 0.85.13 │ │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ │ └── @glimmer/syntax 0.84.3 │ │ └─┬ ember-auto-import 2.7.2 │ │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ tracked-toolbox 2.0.0 └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-resources 6.5.1 ├─┬ ember-async-data 1.0.3 │ └─┬ ember-source 5.6.0 peer │ ├─┬ @glimmer/compiler 0.85.13 │ │ └── @glimmer/syntax 0.85.13 │ ├── @glimmer/syntax 0.85.13 │ ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ │ └── @glimmer/syntax 0.84.3 │ └─┬ ember-auto-import 2.7.2 │ └─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-source 5.6.0 peer ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-source 5.6.0 ├─┬ @glimmer/compiler 0.85.13 │ └── @glimmer/syntax 0.85.13 ├── @glimmer/syntax 0.85.13 ├─┬ babel-plugin-ember-template-compilation 2.2.1 │ └── @glimmer/syntax 0.84.3 └─┬ ember-auto-import 2.7.2 └─┬ babel-plugin-ember-template-compilation 2.2.1 └── @glimmer/syntax 0.84.3 ember-template-lint 5.13.0 └─┬ ember-template-recast 6.1.4 └── @glimmer/syntax 0.84.3 eslint-plugin-ember 12.0.0 └─┬ ember-eslint-parser 0.2.5 └── @glimmer/syntax 0.85.13 ```
NullVoxPopuli commented 9 months ago

Potentially solved by: https://github.com/typed-ember/glint/pull/696

NullVoxPopuli commented 9 months ago

Figured out a work-around.

There is a bug with older @glimmer (back then it distributed as cjs) that indeed did not include @glimmer/env.

I've resolved this with pnpm's packageExtensions config like this (note the lack of caret ranges):

"pnpm": {
    "packageExtensions": {
      "@glint/core": {
        "dependencies": {
          "@glimmer/syntax": "0.84.3"
        }
      },
      "@glimmer/syntax@0.84.3": {
          "dependencies": {
            "@glimmer/env": "*"
          }
      }
    }
}

I think this issue could be resolved when Glint can get the glimmer deps upgraded in #696