jaredpalmer / razzle

✨ Create server-rendered universal JavaScript applications with no configuration
https://razzlejs.org
MIT License
11.11k stars 867 forks source link

assets[entrypoint].js.map is not a function #1887

Closed robertnicjoo closed 2 years ago

robertnicjoo commented 2 years ago

I just created new app and on my very first run of yarn start I am getting this error

✔ Client
  Compiled successfully in 1.13s

✔ Server
  Compiled successfully in 179.78ms

✅  Server-side HMR Enabled!
> Started on port 3000

TypeError: assets[entrypoint].js.map is not a function

  15 |
  16 | const jsScriptTagsFromAssets = (assets, entrypoint, ...extra) => {
> 17 |   return assets[entrypoint] ? assets[entrypoint].js ?
  18 |   assets[entrypoint].js.map(asset=>
  19 |     `<script src="${asset}" ${extra.join(" ")}></script>`
  20 |   ).join('') : '' : '';

any idea?

robertnicjoo commented 2 years ago

Ok, this part of documentation helped to solve the issue:

To make sure Razzle is installed properly make sure Razzle devDependencies are installed, run:

yarn add --dev \
  razzle \
  razzle-dev-utils \
  babel-preset-razzle

... and Razzle peerDependencies are installed, run:

yarn add --dev \
  webpack-dev-server@3.11.0 \
  mini-css-extract-plugin@0.9.0 \
  postcss@8.2.4