Closed socketopp closed 5 months ago
If you're doing this:
const Maizzle = require('@maizzle/framework')
that exports several methods, including serve
which loads Browsersync:
Try destructuring it and only get the render
export:
const { render } = require('@maizzle/framework')
So something like this perhaps:
const { render } = require('@maizzle/framework')
async function renderHtml() {
let { html } = await render('your HTML', options)
return html
}
renderHtml()
const { render } = require('@maizzle/framework')
Do @maizzle/framework support ESM?
import { render } from '@maizzle/framework'
I did this but the errors kept coming.
Maizzle is CJS but you should be able to import CJS in ESM.
Make sure you either have "type": "module"
in your package.json
or just use the .mjs
extension for your file where you're importing Maizzle.
Maizzle is CJS but you should be able to import CJS in ESM.
Make sure you either have
"type": "module"
in yourpackage.json
or just use the.mjs
extension for your file where you're importing Maizzle.
Using module
. However, I don't think using .mjs
will work in my SvelteKit project since rollup have problems parsing it.
[vite] Pre-transform error: Expected ',', got ':'
11:13:18 [vite] Error when evaluating SSR module /src/routes/dashboard/campaigns/+page.svelte: failed to import "/src/lib/emails/maizzle.mjs"
|- RollupError: Expected ',', got ':'
I see. Try asking in the Svelte community for a workaround, unfortunately I'm not familiar with it or Rollup, sorry.
Hi all,
Seems others have managed but not sure how best to get around issues with Browser-sync requirements when trying to just use Maizzle as an API within SvelteKit (via the @maizzle/framework library)
Current Errors are related to emitter and
ERROR: No loader is configured for ".map"
. Anyone have any ideas how to fix this?