Prism: plsql extend sql.But plsql before sql to define.

Created on 22 Jun 2018  路  6Comments  路  Source: PrismJS/prism

My npm package is 1.15.0. I install prism package used cnpm.

In prism.js, the line 5392 is the code what plsql language extend sql start define.
image

but the sql language defined by line 6912
image

So when I import prism to my code. I will get this error in console.
image
image

How to resolve this problem.

support

Most helpful comment

@colshacol
You have to import import "prismjs/components/prism-markup"; markup before JSX (and change the highlighted language to jsx) and it will work.

All 6 comments

How are you bundling prism?

Based on the linked ticket, this appears to be build-related. Ideally, you should be using babel-plugin-prism to bundle prism, but without more information, I don't think this is a bug on our end.

I test this bug start at v1.11.0.

I commont all my code in index.js except import PrismJs from 'prismjs';. Then start my project and open my home page.
It always throw this exception when the version above '1.11.0'.

@jaune162 We would need the above question answered or a reproducible test case to look at before we can help you.

I seem to be having a similar issue.

(CodeSandbox to reproduce found here.)

When using prismjs/components/prism-javascript and prismjs/components/prism-jsx, I receive two different errors. (At random. Never know which one will happen.)

# Most commonly:
"Cannot set property 'comment' of undefined"
# And sometimes:
"Cannot read property 'tag' of undefined"

It seems like the comment error happens more often when prism-jsx is imported _after_ prism-javascript.

Here are a handful of screenshots to give you a quick glance at it:

screen shot 2018-11-23 at 12 46 11 am
screen shot 2018-11-23 at 12 44 56 am
screen shot 2018-11-23 at 12 44 47 am
screen shot 2018-11-23 at 12 43 45 am
screen shot 2018-11-23 at 12 40 44 am
screen shot 2018-11-23 at 12 40 32 am

@colshacol
You have to import import "prismjs/components/prism-markup"; markup before JSX (and change the highlighted language to jsx) and it will work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donnieflorence picture donnieflorence  路  4Comments

myst729 picture myst729  路  6Comments

markerikson picture markerikson  路  3Comments

RobLoach picture RobLoach  路  9Comments

timgoeller picture timgoeller  路  4Comments