In my recent Laravel + Tailwind installation, tailwind.config.js is included as an ES Module. This causes the following error on blast:launch and blast:publish:
php artisan blast:launch
0/2 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] Reusing npm dependencies...
1/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░] Generating Stories...Error [ERR_REQUIRE_ESM]: require() of ES Module /e/server/gigsalad-laravel/laravel/tailwind.config.js
from /e/server/gigsalad-laravel/laravel/vendor/area17/blast/src/resolveTailwindConfig.js not supported.
Instead change the require of tailwind.config.js in /e/server/gigsalad-laravel/laravel/vendor/area17/blast/src/resolveTailwindConfig.js to a dynamic import()
which is available in all CommonJS modules.
at Object.<anonymous> (/e/server/gigsalad-laravel/laravel/vendor/area17/blast/src/resolveTailwindConfig.js:6:18) {
code: 'ERR_REQUIRE_ESM'
}
In my recent Laravel + Tailwind installation,
tailwind.config.js
is included as an ES Module. This causes the following error onblast:launch
andblast:publish
:It appears Tailwind generates an ESM config file by default depending on other settings in your project: https://tailwindcss.com/docs/configuration#using-esm-or-type-script
And it looks like Laravel has configured
package.json
astype: module
since version 10.2: https://github.com/laravel/laravel/blob/25070a3ffb175c15b59cd7f12289a9648165bba3/CHANGELOG.md?plain=1#L34By supporting both ESM and CommonJS formats, Blast will be more able to provide documentation "out of the box" going forward.