laravel-frontend-presets / tall

A TALL (Tailwind CSS, Alpine.js, Laravel and Livewire) Preset for Laravel
MIT License
2.42k stars 203 forks source link

Rename postcss.config.js to postcss.config.cjs #128

Closed ahosker closed 1 year ago

ahosker commented 1 year ago

On Default Laravel Sail Install the original STUB causes an error this solves the issue.

Renaming postcss.config.js to postcss.config.cjs fixes it (as the error advises)

Apparently, because package.json uses the contains "type".

Fixes Error:

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Failed to load PostCSS config: Failed to load PostCSS config (searchPath: /var/www/html): [Failed to load PostCSS config] Failed to load PostCSS config (searchPath: /var/www/html): [ReferenceError] module is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/var/www/html/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
ReferenceError: module is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/var/www/html/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///var/www/html/postcss.config.js:1:1
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
]

Node.js v18.16.0
danharrin commented 1 year ago

Thanks