Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Unexpected token import #40

@aftabnaveed

Description

@aftabnaveed

When I replace my hypernova.js file with the example code provided I get this error. I am using Create React App and my hypernova.js file is placed outside the src folder. Here is my code.

import { renderReact } from 'hypernova-react';
import App from './src/App';

export default renderReact(
    'App.hypernova.js', // this file's name (or really any unique name)
    App,
);
node hypernova.js 
/srv/project/theme/adminlte/ui/hypernova.js:1
(function (exports, require, module, __filename, __dirname) { import { renderReact } from 'hypernova-react';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions