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

Babel not working for library code #1046

@piu130

Description

@piu130

Bug?

  • What version of Neutrino are you using?
    "neutrino": "^8.3.0"

  • Are you trying to use any presets? If so, which ones, and what versions?
    "@neutrinojs/react": "^8.3.0"

  • Are you using the Yarn client or the npm client? What version?
    "yarn": "1.9.4"

  • What version of Node.js are you using?
    "node": "10.8.0"

  • What did you do?
    I created a project with npx @neutrinojs/create-project test, and added a library (react-native-elements) that uses object spread syntax.

  • What did you expect to happen?
    It should compile and display the website.

  • What actually happened, contrary to your expectations?
    This error (and many others):

Module parse failed: Unexpected token (9:4)
You may need an appropriate loader to handle this file type.

const styles = StyleSheet.create({
  text: {
    ...Platform.select({ // <---- error here (spread syntax)
      android: {
        ...fonts.android.regular,

How do I configure babel to support library code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions