infosum / cypress-tags

Use custom tags to slice up Cypress test runs
83 stars 20 forks source link

Type CardModule does not have 'ɵmod' property #228

Open samyak087 opened 1 year ago

samyak087 commented 1 year ago

Project consist of angular+Storybook both->angular version 10 and storybook version 6.0.10. After upgrading angular version from 9 to 10 when I am running commands of storybook all the commands are executing successfully in my VSCode termial but after running npm run storybook when the localhost open I am seeing emod error in the storybook in browser. Approaches tried but nothing worked in our case:-

Deleted node_modules and run npm install then also error is coming in storybook. Checked the imports also whether they are properly imported or not. Deleted package.json and running the commands also not worked. When I was running the storybook in Angular 9 the error was not there but after upgrading it to 10 it's showing emod error I am getting the following error-

Type CardModule does not have 'ɵmod' property.

Error: Type CardModule does not have 'ɵmod' property. at getNgModuleDef (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:58073:15) at recurse (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:80466:21) at recurse (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:80477:17) at registerNgModuleType (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:80462:5) at new NgModuleFactory$1 (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:80576:13) at compileNgModuleFactory__POST_R3__ (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:84125:27) at PlatformRef.bootstrapModule (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:84363:16) at draw (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:143727:32) at push../node_modules/@storybook/angular/dist/client/preview/angular/helpers.js.exports.renderNgApp (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:143740:9) at StoryRenderer.render (http://localhost:6006/vendors~main.a5a6658d3970dfcc7f63.bundle.js:143832:15)

My Package.json looks like after upgrade to angular 10-

{ "name": "project_1", "version": "0.0.1", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "jest", "postinstall": "ngcc", "test:watch": "jest --watch", "test:coverage": "jest --coverage", "test:generate-output": "jest --json --outputFile=.jest-test-results.json || true", "lint": "eslint --fix -c .eslintrc.json --ext .ts ./src ./projects", "e2e": "ng e2e", "build:@project/core": "ng build reach-core --prod && npm run build:scss-all", "build:scss-all": "npm run build:scss && npm run build:stepper-scss", "build:scss": "scss-bundle -p scss-bundle.config.json", "build:stepper-scss": "scss-bundle -p stepper-scss-bundle.config.json", "storybook:prebuild": "npm run test:generate-output", "storybook": "start-storybook -p 6006 -c .storybook", "build-storybook": "build-storybook -c .storybook -o static-files && copyfiles server/* static-files", "deploy:storybook": "npx http-server static-files --ssl --key BusinessLoadBalancer.pem --cert STAR_business_com.crt" }, "private": true, "dependencies": { "@angular/animations": "~10.2.5", "@angular/cdk": "10.2.7", "@angular/common": "~10.2.5", "@angular/compiler": "10.2.5", "@angular/core": "~10.2.5", "@angular/flex-layout": "^9.0.0-beta.31", "@angular/forms": "10.2.5", "@angular/localize": "^10.2.5", "@angular/material": "10.2.7", "@angular/platform-browser": "10.2.5", "@angular/platform-browser-dynamic": "~10.2.5", "@angular/router": "~10.2.5", "ngx-mask": "^10.0.1", "core-js": "^3.6.5", "rxjs": "^6.6.2", "scss-bundle": "^3.1.2", "ts-jest": "^26.2.0", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.1002.4", "@angular-devkit/build-ng-packagr": "~0.1002.4", "@angular-eslint/eslint-plugin": "0.0.1-alpha.32", "@angular/cli": "~10.2.4", "@angular/compiler-cli": "10.2.5", "@angular/language-service": "~10.2.5", "@babel/core": "^7.11.1", "@storybook/addon-a11y": "^6.0.10", "@storybook/addon-actions": "^6.0.10", "@storybook/addon-backgrounds": "^6.0.10", "@storybook/addon-centered": "^5.3.19", "@storybook/addon-cssresources": "^6.0.10", "@storybook/addon-docs": "^6.0.10", "@storybook/addon-jest": "^6.0.10", "@storybook/addon-knobs": "^6.0.10", "@storybook/addon-links": "^6.0.10", "@storybook/addon-notes": "^5.3.19", "@storybook/addon-storysource": "^6.0.10", "@storybook/addon-viewport": "^6.0.10", "@storybook/addons": "^6.0.10", "@storybook/angular": "^6.0.10", "@storybook/theming": "^6.0.10", "@testing-library/angular": "^9.2.2", "@testing-library/jest-dom": "^5.11.3", "@types/jest": "^26.0.9", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "^3.9.1", "@typescript-eslint/eslint-plugin-tslint": "^3.9.1", "@typescript-eslint/parser": "^3.9.1", "babel-loader": "^8.1.0", "codelyzer": "^5.1.2", "copyfiles": "^2.3.0", "eslint": "^7.7.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-jsdoc": "^28.7.0", "eslint-plugin-prefer-arrow": "^1.2.2", "jest": "^26.3.0", "jest-preset-angular": "^8.2.1", "jest-sonar": "^0.2.10", "ng-packagr": "^10.1.0", "protractor": "~7.0.0", "storybook-addon-themes": "^5.4.1", "storybook-dark-mode": "^1.0.0", "ts-node": "^8.9.0", "tslint": "~6.1.0", "typescript": "4.0.8" }, "jest": { "preset": "jest-preset-angular", "setupFilesAfterEnv": [ "/jest-config/setup.ts" ] } }

The command did upgrade required dependencies to version 10 but threw error in browser after running npm run storybook. I tried looking for a solution on internet, but didn't find much.