abstractFlo/atlas

some npm module format wrong on build

izcream opened this issue · 0 comments

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