preact icon indicating copy to clipboard operation
preact copied to clipboard

10.5.13 breaks something in compat/server.mjs (vs. 10.5.12)

Open Amit-A opened this issue 3 years ago • 6 comments

When I upgrade npm packages in my project, preact 10.5.13 breaks my webpack build with this error:

ERROR in ./node_modules/preact/compat/server.mjs 1:0-4:33 Can't reexport the named export 'renderToString' from non EcmaScript module (only default export is available) @ ./node_modules/@apollo/react-ssr/lib/react-ssr.esm.js @ ./node_modules/react-apollo/lib/react-apollo.esm.js @ ...

Downgrading to preact 10.5.12 fixes the issue... so something is broken in 10.5.13?!

Amit-A avatar Mar 22 '21 20:03 Amit-A

Can you list the version of webpack and whatever other bundler youre using?

developit avatar Mar 23 '21 23:03 developit

"webpack": "^4.46.0"

Amit-A avatar Mar 24 '21 00:03 Amit-A

This is related to #3059 + #3061.

What version of preact-render-to-string do you have?

developit avatar Mar 30 '21 15:03 developit

"preact-render-to-string": "^5.1.18"

Amit-A avatar Mar 30 '21 16:03 Amit-A

Hey! Chiming in to say that I’m also seeing this issue with the following versions:

"preact": "^10.6.4"
"preact-render-to-string": "^5.1.19"
"webpack": "^4.46.0"

phacks avatar Jan 05 '22 17:01 phacks

Error still existing :(

"preact": "~10.7.1",
"preact-render-to-string": "~5.2.0",

app_1  | ERROR in ../../node_modules/preact/compat/server.mjs 1:0-97
app_1  | Module not found: Error: Can't resolve 'preact-render-to-string' in '/root/app/node_modules/preact/compat'

Additional issue in my side:

app_1  | export 'renderToStaticMarkup' (imported as 'renderToStaticMarkup') was not found in 'react-dom/server' (module has no exports)

I just wanted to tryout quickly preact over react but the journey stop there today, any help would be apreciated so I can do a benchmark on our app and status on the use of preact :)

I'm using latest babel ~7.17.9 & webpack ~5.72.0 and all the alias are correctly defined.

Hideman85 avatar May 04 '22 18:05 Hideman85

Just checked and I can't reproduce the issue anymore with the latest preact version and latest version of preact-render-to-string 🎉

marvinhagemeister avatar Oct 15 '22 12:10 marvinhagemeister