Skip to content

Including source maps in the action directory causes deployments to fail. #120

@jthomas

Description

@jthomas

Trying to deploy a built TS project with the source map file in the package directory causes the deployment to fail.

$ tree packages                                                                                                
packages
└── default
    ├── index.js
    └── index.js.map

1 directory, 2 files
$nim-dev project deploy .                                                                                        
Deploying project '/Users/jamesthomas/code/nimbella/metrics-platform'
  to namespace 'jamesnim-iaexrm5akbm'
  on host 'https://apigcp.nimbella.io'

Deployed actions ('nim action get <actionName> --url' for URL):
  - index
Failures:
 ›   Error: While deploying action index.js: Action 'index.js' not deployed: runtime type could not be determined

After a lot of head scratching - I found out the index.js.map file is being assumed to be a separate action. Here is the deploy structure created.

 nim:deployer:api   packages: [
  nim:deployer:api     {
  nim:deployer:api       name: 'default',
  nim:deployer:api       actions: [
  nim:deployer:api         {
  nim:deployer:api           name: 'index',
  nim:deployer:api           file: 'packages/default/index.js',
  nim:deployer:api           displayFile: 'nimbella-corp/metrics-platform/default/index.js',
  nim:deployer:api           runtime: 'nodejs:default',
  nim:deployer:api           binary: false,
  nim:deployer:api           zipped: false,
  nim:deployer:api           package: 'default',
  nim:deployer:api           main: 'get_account_usage',
  nim:deployer:api           web: true,
  nim:deployer:api           build: undefined
  nim:deployer:api         },
  nim:deployer:api         {
  nim:deployer:api           name: 'index.js',
  nim:deployer:api           file: 'packages/default/index.js.map',
  nim:deployer:api           displayFile: 'nimbella-corp/metrics-platform/default/index.js.map',
  nim:deployer:api           runtime: undefined,
  nim:deployer:api           binary: false,
  nim:deployer:api           zipped: false,
  nim:deployer:api           package: 'default',
  nim:deployer:api           web: true,
  nim:deployer:api           build: undefined
  nim:deployer:api         }
  nim:deployer:api       ],
  nim:deployer:api       shared: false
  nim:deployer:api     }
  nim:deployer:api   ],

The error is correct (the action with a .map extension has no runtime) but I wonder why we would try to deploy an action where we can't determine the runtime? This doesn't make sense to me as an end-user. Need to think about whether this behaviour makes sense.

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