Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno 1.36.4 issues with aws cdk #243

Open
jordandobrev opened this issue Sep 12, 2023 · 3 comments
Open

Deno 1.36.4 issues with aws cdk #243

jordandobrev opened this issue Sep 12, 2023 · 3 comments

Comments

@jordandobrev
Copy link

jordandobrev commented Sep 12, 2023

Hey 馃憢

Tried running Deno 1.36.4 by cloning the repo, bumping the deno version and uploading a new layer. I do however get the following issues trying to use aws cdk via the npm specifier:

TypeError [ERR_INVALID_ARG_TYPE]" argument must be of type string. Received null
at assertPath (ext:deno_node/path/_util.ts:10:11)
at join (ext:deno_node/path/_posix.ts:77:5)
at getCredentialsFilepath (file:///tmp/deno_dir/npm/registry.npmjs.org/@smithy/shared-ini-file-loader/2.0.8/dist-cjs/getCredentialsFilepath.js:7:99)
at loadSharedConfigFiles (file:///tmp/deno_dir/npm/registry.npmjs.org/@smithy/shared-ini-file-loader/2.0.8/dist-cjs/loadSharedConfigFiles.js:11:76)
at file:///tmp/deno_dir/npm/registry.npmjs.org/@smithy/node-config-provider/2.0.9/dist-cjs/fromSharedConfigFiles.js:8:102
at file:///tmp/deno_dir/npm/registry.npmjs.org/@smithy/property-provider/2.0.7/dist-cjs/chain.js:12:39
at async coalesceProvider (file:///tmp/deno_dir/npm/registry.npmjs.org/@smithy/property-provider/2.0.7/dist-cjs/memoize.js:14:24)
at async file:///tmp/deno_dir/npm/registry.npmjs.org/@smithy/property-provider/2.0.7/dist-cjs/memoize.js:26:28 {
code: "ERR_INVALID_ARG_TYPE",
name: "TypeError",
toString: [Function (anonymous)]
}

The error is caused by this:

export { SSMClient, GetParameterCommand } from "npm:@aws-sdk/client-ssm"

export default async function () {
  console.log("DENO VERSION", Deno.version.deno)
  const client = new SSMClient()

  const command = new GetParameterCommand({
    Name: Deno.env.get("SSM_CONFIG"),
    WithDecryption: true,
  })

  try {
    console.log('Loading SSM', Deno.env.get("SSM_CONFIG"))

    // FAILS HERE
    const response = await client.send(command)

    const config = JSON.parse(response.Parameter.Value)

    for (const [key, value] of Object.entries(config)) {
      console.log([key, value])

      Deno.env.set(key, String(value))
    }
  } catch (e) {
    console.log('Error:', e)
    Deno.exit();
  }
}

The code does work locally, however I can't get it working with the layer.

It does look like the runtime and/or bootstrap files probably need updating to support the latest Deno changes. Did anyone manage to get that working? Is this project still supported or has it been abandoned, as I can see no updates have been made since v 1.32?

@Mystogab
Copy link

I'm not having this issue but I'm worried about the v1.32 fixed in this compatibility layer (AWS Layer), I would love if they pump up to 1.37 but I think you'll need to make some changes on how data comes to Deno

@jordandobrev
Copy link
Author

Looks like the repo is no longer being kept up to date with the latest releases. Hopefully sth new will come up or someone will take over. Hat down to Andy for doing it for this long.

@luistio
Copy link

luistio commented Mar 11, 2024

I was having the same issue, I found a workaround that is working fine for me, not sure if will work for you, but just in case.

I had to set up the below envs(any value is fine):

AWS_CONFIG_FILE=NONE
AWS_SHARED_CREDENTIALS_FILE=NONE

I found the issue is on node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants