preact icon indicating copy to clipboard operation
preact copied to clipboard

node_modules/preact/compat/server.mjs Module not found: Error: Can't resolve 'preact-render-to-string' in

Open rahulbhadhoriya opened this issue 3 years ago • 5 comments

after version 10.5.13 i am getting this error while building

ERROR in ./node_modules/preact/compat/server.mjs Module not found: Error: Can't resolve 'preact-render-to-string' in '/Users/B0216312/Desktop/node_modules/preact/compat' @ ./node_modules/preact/compat/server.mjs 1:0-4:33 1:0-4:33 1:0-4:33 @ ./node_modules/google-maps-react/dist/components/InfoWindow.js @ ./node_modules/google-maps-react/dist/index.js @ ./app/modules/homes/pages/broadband/feasibility/Map.js @ ./app/modules/homes/pages/broadband/feasibility/FeasibilitySmart.js @ ./app/modules/homes/pages/broadband/feasibility/FeasibilityMain.js @ ./app/modules/homes/pages/broadband/home-page/HomePage.js @ ./app/modules/homes/lazy.js @ ./app/modules/homes/routes.js @ ./app/modules/homes/App.js @ ./app/modules/homes/common/containers/Root.js @ ./app/modules/homes/index.js @ multi (webpack)-dev-server/client?http://0.0.0.0 (webpack)/hot/dev-server.js @babel/polyfill ./app/modules/homes/index.js

Originally posted by @rahulbhadhoriya in https://github.com/preactjs/preact/issues/3061#issuecomment-811289446

rahulbhadhoriya avatar Mar 31 '21 17:03 rahulbhadhoriya

downgrading to 10.5.12 works fine.

rahulbhadhoriya avatar Mar 31 '21 17:03 rahulbhadhoriya

Hmm I wonder if this is caused by preact/compat not having the preact-render-to-string dependency.

JoviDeCroock avatar Apr 21 '21 11:04 JoviDeCroock

Possibly, yeah. Maybe the upgrade switched his build to use MJS and that caused the import to fail instead of returning undefined?

developit avatar Apr 27 '21 02:04 developit

@JoviDeCroock @developit is there any update on this? I am trying to upgrade to Next11, using next-plugin-preact but also encountering this error when running yarn build. I tried downgrading to 10.5.12 but did not have any luck.

dross15 avatar Sep 10 '21 22:09 dross15

@dross15 this has been fixed in the newer versions of next-plugin-preact and @preact/compat

JoviDeCroock avatar Jun 17 '22 20:06 JoviDeCroock