Can't make prerender work when a (node_)module imports JSON file #793
-
I'm trying to prerender an app and add Twind compiled shims to the mix (would love to use Hoofd too later). Following the samples provided by the WMR docs as well as those from Twind I ended up adding a import { prerender as ssr } from 'preact-iso'
import 'twind/shim/server'
export default async (app, options = {}) => {
const result = await ssr(app)
result.html = `${result.html}`
return result
} As you can see there's no real use of Twind shim in the source code yet, only an import. My export async function prerender(data) {
const { default: prerender } = await import('./prerender')
return prerender(<App {...data} />, { shim: true })
} Everything works well with Error: Could not load json:npm/[email protected]/lib/maps/entities.json (imported by npm/[email protected]/lib/Tokenizer.js): ENOENT: no such file or directory, open '/Users/raphael/src/ceptem/ceptem-website/public/npm/[email protected]/lib/maps/entities.json' Or same error with
The import chain is as follow:
And, as said, these files exist. Now, I don't post this as an issue as I think it's coming from an incorrect usage of mine, does anyone has any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'll need to take a look at the errors myself a bit later, but Twind does offer a WMR integration, should work right out of the box for you. |
Beta Was this translation helpful? Give feedback.
I'll need to take a look at the errors myself a bit later, but Twind does offer a WMR integration, should work right out of the box for you.