aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.94k stars 559 forks source link

Support for the experimental syntax 'importAttributes' isn't currently enabled #936

Closed jahirfiquitiva closed 5 months ago

jahirfiquitiva commented 5 months ago

What version of million are you using?

3.0.2

Are you using an SSR adapter? If so, which one?

Vercel

What package manager are you using?

yarn

What operating system are you using?

Mac

What browser are you using?

Arc

Describe the Bug

I tried upgrading my website from v 2.6.4 to 3.0.2 but started getting this error.

unhandledRejection SyntaxError: /Users/jahir/dev/jahir/website/.contentlayer/generated/index.mjs: Support for the experimental syntax 'importAttributes' isn't currently enabled (7:43):

   5 | // NOTE During development Contentlayer imports from `.mjs` files to improve HMR speeds.
   6 | // During (production) builds Contentlayer it imports from `.json` files to improve build performance.
>  7 | import allBlogs from './Blog/_index.json' assert { type: 'json' }
     |                                           ^
   8 |
   9 | export { allBlogs }
  10 |

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.

What's the expected result?

The build should be completed normal and successfully

Link to Minimal Reproducible Example

I don't have one, sorry. But here's a PR with the changes I did: https://github.com/jahirfiquitiva/jahir.dev/pull/73

Participation

github-actions[bot] commented 5 months ago

Thanks for opening this issue! A maintainer will review it soon.