0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

prettierの整形の際に出たエラー備忘録

Posted at

環境

"dependencies": {
    "next": "13.5.6",
    "react": "^18",
    "react-dom": "^18"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "@typescript-eslint/eslint-plugin": "^6.19.0",
    "@typescript-eslint/parser": "^6.19.0",
    "autoprefixer": "^10",
    "eslint": "^8.56.0",
    "eslint-config-next": "13.5.6",
    "eslint-plugin-react": "^7.33.2",
    "postcss": "^8",
    "prettier": "^3.2.4",
    "react-hook-form": "^7.49.3",
    "tailwindcss": "^3",
    "typescript": "^5"
  }

今回でたエラー

(node:1050) 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)
[error] Invalid configuration for file "ご自身のプロジェクトパス":
[error] Unexpected token 'export'

解決策

package.jsonに下記を追記するだけ

"type": "module",

追記後のpacage.jsonは下記になります。

  "name": "hogehoge",
  "version": "0.1.0",
  "private": true,
  "type": "module",
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?