question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: uploadAssetsToS3.default is not a function

See original GitHub issue
  DEBUG ─ Deploying bucket nbd4dq8-hfq07z in region us-east-1.
  DEBUG ─ Checking if bucket nbd4dq8-hfq07z exists.
  DEBUG ─ Setting acceleration to "true" for bucket nbd4dq8-hfq07z.
  DEBUG ─ Bucket nbd4dq8-hfq07z was successfully deployed to the us-east-1 region.

  error:
  TypeError: uploadAssetsToS3.default is not a function
    at NextjsComponent.deploy (/home/.serverless/components/registry/npm/serverless-next.js@1.15.0-alpha.2/node_modules/serverless-next.js/serverless.js:187:35)
    at async fn (/mnt/c/Users/code/myApp/node_modules/@serverless/template/utils.js:280:41)
    at async Promise.all (index 0)
    at async executeGraph (/mnt/c/Users/code/myApp/node_modules/@serverless/template/utils.js:294:3)
    at async Template.default (/mnt/c/Users/code/myApp/node_modules/@serverless/template/serverless.js:67:38)
    at async Object.runComponents (/mnt/c/Users/code/myApp/node_modules/@serverless/cli/src/index.js:220:17)

  103s › myApp › TypeError: uploadAssetsToS3.default is not a function

serverless-next.js in package.json "serverless-next.js":"^1.15.0-alpha.2"

my serverless.yml

myApp:
 component: serverless-next.js
 inputs:
  domain: ["mydomain.com"]

serverless --version

Framework Core: 2.18.0
Plugin: 4.4.2
SDK: 2.3.2
Components: 3.4.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
dphangcommented, Jan 14, 2021

Hm, the reason is that uploadAssetsToS3 function was removed from internal package @sls-next/s3-static-assets in this commit: https://github.com/serverless-nextjs/serverless-next.js/commit/000377d2dbc5c7fab53b11ff7f36b0367d706b49. Due to not pinning internal dependencies properly, 1.15 will try to call this old function from the main component package, but it’s incorrectly using a newer dependency version where this was already removed.

I did verify for 1.18 and it is no longer using uploadAssetsToS3 function at all from the main component and it’s also been removed in internal dependency @sls-next/s3-static-assets, so not quite sure why you still have same issue.

Could you maybe remove all modules in your Serverless registry in case it might be using some old code? I think on Mac it should be in/Users/<user>/.serverless/components/registry (sorry, not sure where it would be in other OSes)

0reactions
dphangcommented, Jan 15, 2021

I see, glad it works now. Resolving this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: uploadAssetsToS3.default is not a function
TypeError : uploadAssetsToS3.default is not a function.
Read more >
NextJS Rewrites TypeError: (0 , _resolveRewrites.default) is ...
Enviroment Variables is working, but rewrites feature is not working ... TypeError: (0 , _resolveRewrites.default) is not a function.
Read more >
is not a function or its return value is not iterable in ReactJs ...
React Nodejs Expressjs & MongoDB bug fixing. TypeError : default is not a function or its return value is not iterable in ReactJs...
Read more >
(0 , import_defineToJSON.default) is not a function - Bugs
When trying to import '@8base/auth' to a Vite+Vue 3 project, the following error is trigger by the import statement. Uncaught TypeError: (0 ...
Read more >
(0 , _resolveRewrites.default) is not a function-Reactjs
Coding example for the question NextJS Rewrites TypeError: (0 , _resolveRewrites.default) is not a function-Reactjs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found