question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integration with react-boilerplate

See original GitHub issue

Problem

Hello guys, I’m new to react-ace, very nice project by the way, I liked a lot. I have a very noob question, I just bootstraped a project with https://github.com/react-boilerplate/react-boilerplate, added react-ace as a dependency and everything seems to be working fine.

But I’m getting the error above on the console:

_mode-mode.js:1 Uncaught SyntaxError: Unexpected token <_

It seems that it is something about webpack configuration between both projects? Can you guys recommend anything about this setup?

This is the way I’m using react-ace:

import React, { Component } from 'react';
import AceEditor from 'react-ace';
import messages from './messages';

import 'brace/theme/github';

export default class HomePage extends Component { // eslint-disable-line react/prefer-stateless-function
  render() {
    return (
      <div>
        <AceEditor
          mode=""
          theme="github"
          onChange={() => null}
          name="UNIQUE_ID_OF_DIV"
          editorProps={{ $blockScrolling: true }}
        />
      </div>
    );
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ningcui-compasscommented, Sep 16, 2019

Found the solution: you must specify a mode when using AceEditor

2reactions
IshaTrcommented, Dec 10, 2018

@fbove Try importing import brace from 'brace'; on the top of both the mode and theme imports. worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-boilerplate/react-boilerplate: A highly scalable, offline ...
Quick scaffolding: Create components, containers, routes, selectors and sagas - and their tests - right from the CLI! · Instant feedback · Predictable...
Read more >
How to build your own React boilerplate - Medium
This folder structure is basic and will evolve as you integrate other libraries in the project. Git Ignore. Once we build our project,...
Read more >
12+ React Boilerplates & Starter Kits for Developers in 2022
React boilerplate is the best entry point to quick-start web development. We've choosen top 12 react js boilerplates and starter kits.
Read more >
Boilerplate - React.js Examples
This project is the base template for developing Electron applications using React. 27 February 2022. A simple Vite, SolidJS, Electron integration template.
Read more >
11 React Boilerplates and Starter Kits for 2019 - Bits and Pieces
It's a starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform. While the project's integration ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found