Skip to content

some npm module format wrong on build #41

@izcream

Description

@izcream

Expected Behavior

build file should format import module to import moduleName from moduleName;

Current Behavior

build file format import module to import moduleName;

Steps to Reproduce

  1. import module on atlas server-side code (in this issues is axios,jsonwebtoken)
  2. call import function (in this case is axios.get(url))
  3. build your gamemode (will receive warning message "default" isimported from external module "moduleName"...)
  4. start alt:V server and call (step 2) function

Environments

@abstractflo/atlas-cli: 3.1.0-next.8
@abstractflo/atlas-client: 3.1.0-rc.2
@abstractflo/atlas-server: "^3.1.0-rc.2
@abstractflo/atlas-shared: 3.1.0-rc.2
NodeJS Version: v14.18.1
OS: Ubuntu 20.04

Possible Solution

Look like the problem was happen because one function in convertNamedImports convert module import and nodeJS handle this case too Ref

You can try comment that part of function to inspect result. when comment that part build file was declare import correctly

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