I have upgraded my angular to angular 13. when I run to build SSR it gives me following error.
JavaScript
x
54
54
1
ERROR in ./node_modules/@angular/common/fesm2015/http.mjs 12:0-56
2
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/common/fesm2015'
3
Did you mean 'index.js'?
4
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
5
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
6
The extension in the request is mandatory for it to be fully specified.
7
Add the extension to the request.
8
@ ./src/app/app.server.module.ts 6:0-57 16:25-42
9
@ ./src/main.server.ts 3:0-58 3:0-58
10
@ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
11
12
ERROR in ./node_modules/@angular/core/fesm2015/core.mjs 8:0-39
13
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/core/fesm2015'
14
Did you mean 'index.js'?
15
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
16
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
17
The extension in the request is mandatory for it to be fully specified.
18
Add the extension to the request.
19
@ ./server.ts 30:0-47 35:0-14
20
21
ERROR in ./node_modules/@angular/forms/fesm2015/forms.mjs 11:0-37
22
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/forms/fesm2015'
23
Did you mean 'index.js'?
24
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
25
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
26
The extension in the request is mandatory for it to be fully specified.
27
Add the extension to the request.
28
@ ./src/app/app.module.ts 12:0-45 78:12-23
29
@ ./src/app/app.server.module.ts 3:0-41 12:18-27
30
@ ./src/main.server.ts 3:0-58 3:0-58
31
@ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
32
33
ERROR in ./node_modules/@angular/platform-server/fesm2015/platform-server.mjs 21:0-39
34
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/platform-server/fesm2015'
35
Did you mean 'index.js'?
36
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
37
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
38
The extension in the request is mandatory for it to be fully specified.
39
Add the extension to the request.
40
@ ./src/main.server.ts 4:0-77 4:0-77 4:0-77
41
@ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
42
43
ERROR in ./node_modules/@angular/router/fesm2015/router.mjs 10:0-180
44
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/@angular/router/fesm2015'
45
Did you mean 'index.js'?
46
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
47
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
48
The extension in the request is mandatory for it to be fully specified.
49
Add the extension to the request.
50
@ ./src/app/app.component.ts 2:0-48 35:31-44
51
@ ./src/app/app.server.module.ts 2:0-47 13:20-32
52
@ ./src/main.server.ts 3:0-58 3:0-58
53
@ ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
54
my package.json file:
JavaScript
1
201
201
1
{
2
"name": "admin-panel",
3
"version": "0.0.0",
4
"license": "MIT",
5
"angular-cli": {},
6
"scripts": {
7
"start": "DEBUG=jobsaf-website:* nodemon --inspect --trace-warnings --legacy-watch --trace-warnings ./bin/www",
8
"seed": "node ./seeds/static-tables.js",
9
"test-jobsaf": "mocha --timeout 10000",
10
"rm-web": "rm -rf ./public/web/*",
11
"ng": "node ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0",
12
"ng:build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration production --aot",
13
"build:server:prod": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng run jobsaf-website:server:prod && webpack --config webpack.server.config.js",
14
"build:browser:prod": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng build --configuration production --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer --progress=true",
15
"build:server:staging": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng run jobsaf-website:server:staging && webpack --config webpack.server.config.js",
16
"build:browser:staging": "node --max_old_space_size=4048 ./node_modules/@angular/cli/bin/ng build --configuration production --configuration=staging --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer",
17
"build:stats": "node --max_old_space_size=3192 node_modules/@angular/cli/bin/ng build --configuration production --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer --progress=true --configuration production --stats-json",
18
"build:prod": "npm run rm-web && npm run build:server:prod && npm run build:browser:prod",
19
"build:staging": "npm run rm-web && npm run build:server:staging && npm run build:browser:staging",
20
"server": "node local.js",
21
"file:migration": "APP_FILE_MIGRATION=true node ./migration/file-migration.js",
22
"test_env": "set NODE_ENV=test",
23
"jest": "jest --detectOpenHandles --watchAll --config ./jest.config.js",
24
"coverage": "jest -i --coverage",
25
"jest:ci": "jest --detectOpenHandles --forceExit --config ./jest.config.js",
26
"test": "npm run test_env && npm run jest",
27
"test:ci": "npm run test_env && npm run seed && npm run jest:ci",
28
"dev:ssr": "ng run jobsaf-website:serve-ssr",
29
"serve:ssr": "node public/web/server/main.js",
30
"build:ssr": "ng build --configuration production && ng run jobsaf-website:server:prod",
31
"prerender": "ng run jobsaf-website:prerender",
32
"postinstall": "ngcc"
33
},
34
"private": true,
35
"napa": {
36
"jquery.flot.spline": "miloszfalinski/jquery.flot.spline",
37
"ika.jvectormap": "kakirigi/ika.jvectormap"
38
},
39
"dependencies": {
40
"@angular/animations": "^13.0.2",
41
"@angular/common": "^13.0.2",
42
"@angular/compiler": "^13.0.2",
43
"@angular/compiler-cli": "^13.0.2",
44
"@angular/core": "^13.0.2",
45
"@angular/forms": "^13.0.2",
46
"@angular/material": "^13.0.2",
47
"@angular/platform-browser": "^13.0.2",
48
"@angular/platform-browser-dynamic": "^13.0.2",
49
"@angular/platform-server": "^13.0.2",
50
"@angular/pwa": "^13.0.3",
51
"@angular/router": "^13.0.2",
52
"@angular/service-worker": "^13.0.2",
53
"@fortawesome/angular-fontawesome": "^0.10.1",
54
"@fortawesome/fontawesome-svg-core": "^1.2.36",
55
"@fortawesome/free-brands-svg-icons": "^5.15.4",
56
"@fortawesome/free-solid-svg-icons": "^5.15.4",
57
"@fullcalendar/core": "^5.10.1",
58
"@hapi/joi": "^15.1.0",
59
"@ng-select/ng-select": "^8.1.1",
60
"@nguniversal/common": "^13.0.1",
61
"@nguniversal/express-engine": "^13.0.1",
62
"@ngx-loading-bar/core": "^5.1.2",
63
"@ngxs/store": "^3.7.3-dev.master-1e7127b",
64
"@schematics/angular": "^13.0.3",
65
"@sindresorhus/slugify": "^1.1.0",
66
"@trademe/ng-defer-load": "^8.2.1",
67
"@types/jquery": "^3.5.8",
68
"angular-archwizard": "^7.0.0",
69
"angular2-uuid": "^1.1.1",
70
"apicache": "^1.6.3",
71
"archiver": "^5.3.0",
72
"aws-sdk": "^2.1031.0",
73
"bluebird": "^3.7.2",
74
"bootstrap": "5.1.3",
75
"compression": "^1.7.4",
76
"compromise": "^13.11.4",
77
"cookie-parser": "^1.4.6",
78
"core-js": "3.19.1",
79
"cors": "~2.8.5",
80
"debug": "^4.3.2",
81
"dotenv": "^10.0.0",
82
"easyimage": "^3.1.1",
83
"ejs": "^3.1.6",
84
"exceljs": "^4.3.0",
85
"express": "^4.17.1",
86
"express-jwt": "^6.1.0",
87
"express-mongo-sanitize": "^2.1.0",
88
"express-rate-limit": "^5.5.1",
89
"express-useragent": "^1.0.15",
90
"express-validator": "^6.13.0",
91
"feed": "^4.2.2",
92
"file-saver": "^2.0.5",
93
"firebase-admin": "^10.0.0",
94
"font-awesome": "^4.7.0",
95
"generate-password": "^1.7.0",
96
"google-auth-library": "^7.10.2",
97
"hammerjs": "^2.0.8",
98
"helmet": "^4.6.0",
99
"html-pdf": "^3.0.1",
100
"http-status": "^1.5.0",
101
"intl-tel-input": "^17.0.13",
102
"izitoast": "1.4.0",
103
"joi-objectid": "^4.0.2",
104
"jquery": "^3.6.0",
105
"jsonwebtoken": "^8.5.1",
106
"jwt-decode": "^3.1.2",
107
"keyword-extractor": "0.0.20",
108
"kickbox": "^2.0.4",
109
"libphonenumber-js": "^1.9.43",
110
"localstorage-polyfill": "^1.0.1",
111
"lodash": "^4.17.21",
112
"lodash.uniq": "^4.5.0",
113
"md5": "^2.3.0",
114
"moment": "^2.29.1",
115
"mongoose": "5.8.11",
116
"mongoose-history": "^0.8.0",
117
"mongoose-unique-validator": "^2.0.3",
118
"mongoose-url-slugs": "^1.0.2",
119
"multer": "^1.4.3",
120
"multer-s3": "^2.10.0",
121
"multer-s3-transform": "^2.10.3",
122
"mysql": "^2.18.1",
123
"ng-recaptcha": "^9.0.0",
124
"ng2-file-upload": "^1.4.0",
125
"ngx-auth": "^5.4.0",
126
"ngx-bootstrap": "^6.1.0",
127
"ngx-facebook": "^3.0.0-0",
128
"ngx-img-cropper": "^11.0.0",
129
"ngx-infinite-scroll": "^10.0.1",
130
"ngx-moment": "^5.0.0",
131
"ngx-pagination": "^5.1.1",
132
"ngx-quill-editor": "^2.2.2",
133
"ngx-toastr": "^14.2.0",
134
"node-schedule": "^2.0.0",
135
"nodemailer": "^6.7.1",
136
"passport": "^0.5.0",
137
"passport-facebook-token": "^4.0.0",
138
"passport-google-id-token": "^0.4.7",
139
"passport-google-token": "^0.1.2",
140
"passport-linkedin-token": "^0.1.1",
141
"passport-local": "^1.0.0",
142
"pdf-to-text": "0.0.7",
143
"phantomjs-prebuilt": "^2.1.16",
144
"phone": "^3.1.10",
145
"phpass": "^0.1.1",
146
"rand-token": "^1.0.1",
147
"request": "^2.88.2",
148
"request-ip": "^2.1.3",
149
"rxjs": "^6.5.5",
150
"sharp": "^0.29.3",
151
"showdown": "^1.9.1",
152
"simple-line-icons": "^2.5.5",
153
"socket.io": "^4.3.2",
154
"socket.io-client": "^4.3.2",
155
"socket.io-redis": "^5.4.0",
156
"socketio-auth": "^0.1.1",
157
"textract": "^2.5.0",
158
"ts-loader": "9.2.6",
159
"underscore": "^1.13.1",
160
"unique-random-array": "^2.0.0",
161
"url": "^0.11.0",
162
"util": "^0.12.4",
163
"uuid": "^8.3.2",
164
"winston": "^3.3.3",
165
"xlsx": "^0.17.4",
166
"xss-clean": "^0.1.1",
167
"zone.js": "~0.11.4",
168
"zxcvbn": "^4.4.2"
169
},
170
"devDependencies": {
171
"@angular-devkit/build-angular": "~13.0.3",
172
"@angular/cli": "^13.0.3",
173
"@types/express": "^4.17.13",
174
"@types/hammerjs": "^2.0.40",
175
"@types/mocha": "^9.0.0",
176
"@types/node": "^16.11.7",
177
"@types/underscore": "^1.11.3",
178
"husky": "^7.0.0",
179
"jasmine-core": "~3.10.1",
180
"jasmine-spec-reporter": "~7.0.0",
181
"jest": "^27.3.1",
182
"karma": "^6.3.9",
183
"karma-chrome-launcher": "~3.1.0",
184
"karma-coverage-istanbul-reporter": "^3.0.3",
185
"karma-jasmine": "~4.0.1",
186
"karma-jasmine-html-reporter": "^1.7.0",
187
"lint-staged": "^12.0.2",
188
"mocha": "^9.1.3",
189
"ng-diff-match-patch": "^3.0.1",
190
"nodemon": "^2.0.15",
191
"protractor": "^7.0.0",
192
"supertest": "^6.1.6",
193
"tslib": "^2.3.1",
194
"tslint": "^6.1.3",
195
"typescript": "4.4.3",
196
"webpack": "^5.64.1",
197
"webpack-cli": "^4.9.1"
198
}
199
}
200
201
Any Idea
Advertisement
Answer
I just solve this issue by correcting the RxJS version to 7.4.0
. I hope this can solve others issue as well.