Skip to content

Commit ac5216b

Browse files
committed
Supp
On the console you'll see a lot of errors like this: > Uncaught SyntaxError: Unexpected token o in JSON at position 1 The reason for that can be found here: PrismJS/prism#1303 This PR applies the recommended fix for that thread and also tried with this PR: conorhastings#32 The fix is to add a prism-config.js that sets `disableWorkerMessageHandler: true` Fixes conorhastings#12
1 parent 8bcb035 commit ac5216b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Text, ScrollView, Platform } from 'react-native';
3+
import "./prism-config.js";
34
import SyntaxHighlighter from 'react-syntax-highlighter';
45
import SyntaxHighlighterPrism from 'react-syntax-highlighter/prism';
56
import { createStyleObject } from 'react-syntax-highlighter/create-element';

src/prism-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global.Prism = { disableWorkerMessageHandler: true };

0 commit comments

Comments
 (0)