darshanbaral / aafu

Portfolio theme with blog
https://themes.gohugo.io/aafu/
MIT License
47 stars 58 forks source link

"type": "module" in the package.json or use the .mjs extension #30

Open abishekmuthian opened 10 months ago

abishekmuthian commented 10 months ago

Issue with PostCSS, Even after settings "type":"module" in the package.json,

Hugo version: v0.111.3+extended Node JS version : v20.8.1

Start building sites … 
hugo v0.111.3+extended linux/amd64 BuildDate=2023-07-26T00:00:00+00:00 VendorInfo=Fedora:0.111.3-4.fc39
Error: Error building site: POSTCSS: failed to transform "main.css" (text/css): (node:40694) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/abishek/ownCloud/shilpi/node_modules/.bin/postcss:3
import fs from 'fs-extra'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1153:20)
    at Module._compile (node:internal/modules/cjs/loader:1205:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47

Node.js v20.8.1
Built in 305 ms