This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Angular SSR fails during runtime for @material/dom. #2031
Closed
Description
Describe the bug
Angular SSR build fails with the following error:
/Users/madhavansundararaj/Documents/GitHub/temp_project/node_modules/@material/dom/ponyfill.js:27
export function closest(element, selector) {
^^^^^^
SyntaxError: Unexpected token 'export'
at Module._compile (internal/modules/cjs/loader.js:892:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at /Users/madhavansundararaj/Documents/GitHub/temp_project/node_modules/@angular-mdc/web/bundles/web-ripple.umd.js:9:177
at Object.<anonymous> (/Users/madhavansundararaj/Documents/GitHub/temp_project/node_modules/@angular-mdc/web/bundles/web-ripple.umd.js:12:2)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at /Users/madhavansundararaj/Documents/GitHub/temp_project/node_modules/@angular-mdc/web/bundles/web-list.umd.js:9:318
at Object.<anonymous> (/Users/madhavansundararaj/Documents/GitHub/temp_project/node_modules/@angular-mdc/web/bundles/web-list.umd.js:12:2)
To Reproduce
Steps to reproduce the behavior:
- Make any app with angular-mdc-web library and add angular universal to it
- npm run build:ssr and npm run serve:ssr
It will fail on npm run serve:ssr
Expected behavior
npm run serve:ssr should pass
neccessary script:
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "nodemon server.js",
"build:client-and-server-bundles": "ng build --prod && ng run entiya:server:production",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors"
What Angular MDC version are you using?
3.2.0
What OS are you using?:
macOS 10.15
Follow up of #1932 (comment)
@TryHardDood