nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Syntax highlight behavior is different between versions

Open jcrqr opened this issue 2 years ago • 1 comments

Hey 👋🏼

I'm having some issues to get syntax highlighting working properly. I've different behaviors with the stable, alpha and beta versions of Nextra.

For brevity purposes, I'm importing prismjs/components/prism-rego in the pages/_app.jsx and this is the .mdx file that's causing issues:

Some code sample:

```rego
package repository
```

With 1.1.0 (current stable ATTOW):

🔽 Everything compiles correctly but I don't get syntax highlighting (click to expand):

Screen Shot 2022-05-09 at 11 05 56 PM

With 2.0.0-alpha.50 (current alpha ATTOW):

🔽 Doesn't even compile (click to expand):

Screen Shot 2022-05-09 at 11 04 34 PM

With 2.0.0-beta.5 (current beta ATTOW):

🔽 Compiles and works as expected (with next dev), but next build stops working* (click to expand):

Screen Shot 2022-05-09 at 11 11 49 PM

For reference, I'm on:

$ node -v
v16.14.2

$ npm -v       
8.5.5

* The issue I have when upgrading to the beta versions is (click to expand):

Screen Shot 2022-05-09 at 11 14 32 PM

Please, let me know if you need any further details.

Thanks in advance!

jcrqr avatar May 09 '22 22:05 jcrqr

The issue with the errors using npm run build look to be related with something inside the pages/features/mdx.mdx file. I'm still trying to figure out what exactly. FYI I've generated the site using the template in Vercel.

Deleting the file mentioned compiles everything without errors using the beta version.

jcrqr avatar May 10 '22 08:05 jcrqr

Closed since issue related to nextra 1

dimaMachina avatar Jan 23 '23 03:01 dimaMachina