adopted-ember-addons / ember-moment

MIT License
400 stars 122 forks source link

ember-moment is trying to import from ember-cli-moment-shim but that is not one of its explicit dependencies Error thrown while using Embroider compat build #395

Open NagarajNN opened 1 year ago

NagarajNN commented 1 year ago

image

NullVoxPopuli commented 1 year ago

can you provide the text for this error? hard to read as is

NagarajNN commented 1 year ago

can you provide the text for this error? hard to read as is

ember-moment is trying to import from ember-cli-moment-shim but that is not one of its explicit dependencies

NullVoxPopuli commented 1 year ago

that package is not present in the repo: https://github.com/search?q=repo%3Aadopted-ember-addons%2Fember-moment%20shim&type=code

what package manager are you using? npm,yarn,pnpm?

can you tell your package manager to list what copies of ember-moment you have?

pnpm ls ember-moment -r 
npm why ember-moment
yarn why ember-moment
NagarajNN commented 1 year ago

yarn why ember-moment

i'm using yarn as package manager,

and ember-moment version is @10.0.0

NullVoxPopuli commented 1 year ago

can you provide the output of:

yarn why ember-moment
yarn ls ember-moment
NagarajNN commented 1 year ago

yarn why ember-moment

[1/4] Why do we have the module "ember-moment"...? [2/4] Initialising dependency graph... [3/4] Finding dependency... [4/4] Calculating file sizes... => Found "ember-moment@10.0.0" info Has been hoisted to "ember-moment" info This module exists because it's specified in "devDependencies". info Disk size without dependencies: "244KB" info Disk size with unique dependencies: "536KB" info Disk size with transitive dependencies: "6.73MB" info Number of shared dependencies: 17 Done in 1.76s.

yarn list ember-moment

yarn list v1.22.19 warning Filtering by arguments is deprecated. Please use the pattern option instead. └─ ember-moment@10.0.0 Done in 0.80s.

NullVoxPopuli commented 1 year ago

can you also provide the stack trace from the log in your error?

NagarajNN commented 1 year ago

Here is the Stack trace report for your reference,

=================================================================================

ENV Summary:

TIME: Thu Apr 13 2023 19:46:18 GMT+0530 (India Standard Time) TITLE: ember ARGV:

ERROR Summary:

=================================================================================

NullVoxPopuli commented 1 year ago

what is the version in D:\ember-retest\productone\source\ember\web-app\node_modules\ember-moment\package.json?

NullVoxPopuli commented 1 year ago

if you can find where ember-cli-moment-shim is being hit, that'd be a huge help.

NagarajNN commented 1 year ago

what is the version in D:\ember-retest\productone\source\ember\web-app\node_modules\ember-moment\package.json?

"name": "ember-moment", "version": "10.0.0",

{ "name": "ember-moment", "version": "10.0.0", "description": "Moment.js template helpers Ember.js", "keywords": [ "ember-addon", "moment", "momentjs" ], "license": "MIT", "author": "", "exports": { ".": "./dist/index.js", "./": "./dist/", "./addon-main.js": "./addon-main.js" }, "files": [ "addon-main.js", "dist" ], "repository": "https://github.com/adopted-ember-addons/ember-moment.git", "scripts": { "clean": "rm -rf dist node_modules test-app/node_modules", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:", "lint:hbs": "ember-template-lint .", "lint:js": "eslint .", "lint:devdeps": "addon-dev sync-dev-deps --lint", "scenario:list": "scenario-tester list --files test-app/scenarios.js", "scenario:output": "scenario-tester output --files test-app/scenarios.js --outdir scenario --scenario ", "scenario:run": "cd test-app && qunit scenarios.js --filter ", "start": "npm-run-all --parallel start:", "start:test-app": "cd test-app && ember serve", "start:build": "rollup --config --watch", "sync-dev-deps": "addon-dev sync-dev-deps", "test": "npm-run-all lint: test:", "test:ember": "cd test-app && ember test", "test:ember-compatibility": "cd test-app && qunit scenarios.js", "prepare": "npm-run-all prepublishOnly link-test-app", "link-test-app": "addon-dev link-test-app", "prepublishOnly": "rollup --config" }, "dependencies": { "@embroider/addon-shim": "^0.50.2" }, "devDependencies": { "@babel/core": "^7.16.7", "@ember/optional-features": "^2.0.0", "@ember/test-helpers": "^2.6.0", "@embroider/addon-dev": "^0.50.2", "@embroider/compat": "npm:@embroider/compat@latest", "@embroider/core": "npm:@embroider/core@latest", "@embroider/test-setup": "npm:@embroider/test-setup@latest", "@embroider/webpack": "npm:@embroider/webpack@latest", "@glimmer/component": "^1.0.4", "@glimmer/tracking": "^1.0.4", "@rollup/plugin-babel": "^5.3.0", "babel-eslint": "^10.1.0", "ember-auto-import": "^2.3.0", "ember-cli-3.16": "npm:ember-cli@~3.16.0", "ember-cli-3.20": "npm:ember-cli@~3.20.0", "ember-cli-3.24": "npm:ember-cli@~3.24.0", "ember-cli-babel": "^7.26.10", "ember-cli-beta": "npm:ember-cli@beta", "ember-cli-htmlbars": "^5.7.2", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-latest": "npm:ember-cli@latest", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.2", "ember-cli": "~3.28.5", "ember-disable-prototype-extensions": "^1.1.3", "ember-export-application-global": "^2.0.1", "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "0.1.6", "ember-page-title": "^7.0.0", "ember-qunit": "^5.1.5", "ember-resolver": "^8.0.3", "ember-source-3.16": "npm:ember-source@~3.16.0", "ember-source-3.20": "npm:ember-source@~3.20.0", "ember-source-3.24": "npm:ember-source@~3.24.0", "ember-source-beta": "npm:ember-source@beta", "ember-source-canary": "npm:ember-source@alpha", "ember-source-channel-url": "^3.0.0", "ember-source-latest": "npm:ember-source@latest", "ember-source": "~3.28.8", "ember-template-lint": "^3.15.0", "ember-try": "^1.4.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-ember": "^10.5.8", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.1", "eslint-plugin-qunit": "^6.2.0", "eslint": "^7.32.0", "jquery": "^3.6.0", "loader.js": "^4.7.0", "moment-timezone": "^0.5.33", "npm-run-all": "^4.1.5", "prettier": "^2.5.1", "qunit-console-grouper": "^0.3.0", "qunit-dom": "^1.6.0", "qunit": "^2.17.2", "rollup": "^2.63.0", "scenario-tester": "^2.0.1", "webpack": "^5.65.0" }, "peerDependencies": { "moment": "^2", "moment-timezone": "^0.5.34" }, "peerDependenciesMeta": { "moment": { "optional": true }, "moment-timezone": { "optional": true } }, "engines": { "node": ">= 12" }, "ember-addon": { "version": 2, "type": "addon", "main": "addon-main.js", "app-js": { "./helpers/-base.js": "./dist/app/helpers/-base.js", "./helpers/is-after.js": "./dist/app/helpers/is-after.js", "./helpers/is-before.js": "./dist/app/helpers/is-before.js", "./helpers/is-between.js": "./dist/app/helpers/is-between.js", "./helpers/is-same-or-after.js": "./dist/app/helpers/is-same-or-after.js", "./helpers/is-same-or-before.js": "./dist/app/helpers/is-same-or-before.js", "./helpers/is-same.js": "./dist/app/helpers/is-same.js", "./helpers/moment-add.js": "./dist/app/helpers/moment-add.js", "./helpers/moment-calendar.js": "./dist/app/helpers/moment-calendar.js", "./helpers/moment-diff.js": "./dist/app/helpers/moment-diff.js", "./helpers/moment-duration.js": "./dist/app/helpers/moment-duration.js", "./helpers/moment-format.js": "./dist/app/helpers/moment-format.js", "./helpers/moment-from-now.js": "./dist/app/helpers/moment-from-now.js", "./helpers/moment-from.js": "./dist/app/helpers/moment-from.js", "./helpers/moment-subtract.js": "./dist/app/helpers/moment-subtract.js", "./helpers/moment-to-date.js": "./dist/app/helpers/moment-to-date.js", "./helpers/moment-to-now.js": "./dist/app/helpers/moment-to-now.js", "./helpers/moment-to.js": "./dist/app/helpers/moment-to.js", "./helpers/moment.js": "./dist/app/helpers/moment.js", "./helpers/now.js": "./dist/app/helpers/now.js", "./helpers/unix.js": "./dist/app/helpers/unix.js", "./helpers/utc.js": "./dist/app/helpers/utc.js", "./services/moment.js": "./dist/app/services/moment.js" } }, "volta": { "node": "14.17.5", "yarn": "1.22.11" } }

NullVoxPopuli commented 1 year ago

can you use code fences so your code is formatted?

hard to tell what indentation is.

```js

```
or
```json

```
NagarajNN commented 1 year ago

can you use code fences so your code is formatted?

hard to tell what indentation is.

```js

or

json

NullVoxPopuli commented 1 year ago

if you can find where ember-cli-moment-shim is being hit, that'd be a huge help.

can you debug your command with the VSCode JavaScript Debug Terminal and tell it to pause on uncaught exceptions? you should be able to debug where the moment-shim is coming from, and why it's being detected at all

Pixelik commented 9 months ago

I'me having a similar (or actually the same) issue with Ember 4.12 and embroider-safe:

https://github.com/embroider-build/embroider/issues/1598#issuecomment-1718232147