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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Invalid Table" error #34

Closed
brettstack opened this issue Apr 29, 2020 · 5 comments
Closed

Getting "Invalid Table" error #34

brettstack opened this issue Apr 29, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@brettstack
Copy link

This works locally, but when I deploy to Lambda, the table.constructor.name is empty, causing dynamodb-toolbox to throw https://github.com/jeremydaly/dynamodb-toolbox/blob/v0.2/classes/Entity.js#L46-L69.

I'm using serverless-webpack which may have something to do with it?

@jeremydaly jeremydaly added the bug Something isn't working label Apr 29, 2020
@jeremydaly
Copy link
Owner

Yes, this is caused by webpack. I'm going to flag this as a bug, although it technically isn't, but clearly needs to be addressed so that it works with webpack out of the box. Thanks for noticing.

jeremydaly added a commit that referenced this issue Apr 30, 2020
@brettstack
Copy link
Author

Confirmed this works 🎉

@jeremydaly
Copy link
Owner

@brettstack, there are a few other places that use the constructor.name syntax (mostly around batches). Let me know if you run into issues with those.

@aldebout
Copy link

aldebout commented May 5, 2020

@jeremydaly this is the same minification issue right?

If so, a temporary fix is to disable minification in your webpack config:

optimization: {
    minimize: false,
  },

@jeremydaly
Copy link
Owner

@aldebout, I'd rather not require that, but yes, should work for temporary fixes. There are other ways to verify the correct instances are passed, so I'll hunt for these and add fixes.

brettstack added a commit to brettstack/dynamodb-toolbox that referenced this issue Nov 4, 2021
Similar to jeremydaly@71f55db and the related issue jeremydaly#34. I'm getting "Invalid Entity" under certain minification conditions where `instanceof` fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants