unjs / listhen

👂 Elegant HTTP Listener
Other
434 stars 29 forks source link

ERROR ParseError: C:\: Support for the experimental syntax 'importAttributes' isn't currently enabled #176

Open nethriis opened 4 months ago

nethriis commented 4 months ago

Environment

OS: Windows 11 Node version: v20.10.0 Package manager: pnpm@9.0.0

Reproduction

app.ts

import { createApp, createRouter, defineEventHandler } from 'h3'

export const app = createApp()

const router = createRouter()

app.use(router)

router.get('/authorize', defineEventHandler(async () => {
    return '<h1>Hello</h1>'
}))

Describe the bug

When I run the command :

listhen -w --open ./app.ts

I have that error :

 ERROR  ParseError: C:\: Support for the experimental syntax 'importAttributes' isn't currently enabled (250:105):          listhen 15:38:49

Add @babel/plugin-syntax-import-attributes (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes) to the 'plugins' section of your Babel config to enable parsing.
 C:/path/to/app/node_modules/.pnpm/@poppinss+utils@6.7.3/node_modules/@poppinss/utils/build/index.js:250:104        

  Add @babel/plugin-syntax-import-attributes (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes) to the 'plugins' section of your Babel config to enable parsing.
  C:/path/to/app/node_modules/.pnpm/@poppinss+utils@6.7.3/node_modules/@poppinss/utils/build/index.js:250:104       
  at C:/path/to/app/node_modules/.pnpm/edge.js@6.0.2/node_modules/edge.js/build/index.js:17:14
  at C:/path/to/app/app.ts:1:171

Additional context

No response

Logs

No response