Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

issue: "Import in body of module; reoder to top", thrown by CRA next branch. #450

@bebbi

Description

@bebbi

This issue is a:

  • Bug report

For my module, nwb has created an es folder with an index.js file starting as follows:

    var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

    import { myThing } from '@myprefix/mylib'
    // etc.

I'm using this in a monorepo together with create-react-app next branch 2.0.0-next.b2fd8db8.

Running a CRA app with a dependency on my nwb lib errors out with

error Import in body of module; reorder to top

I just confirmed this does not happen with react-scripts version 1.1.2, it will run fine.

I'm posting this here for now as I believe the error thrown by CRA is valid.

I will look at a repro in case this is not an obvious issue.

Is the version of nwb you're using installed globally or locally?

global

Which versions of Node.js, npm and nwb are you using (if using it globally)?

node -v 8.9.1
npm -v 5.7.1
# If nwb is being used as a global install
nwb -v 0.21.5

Which modules are installed in your project?

n.a. I think as the bug is triggered at a consumer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions