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

Better errors when using ctx outside action or component #34

Open
coffee-cup opened this issue Sep 6, 2019 · 0 comments
Open

Better errors when using ctx outside action or component #34

coffee-cup opened this issue Sep 6, 2019 · 0 comments
Labels
error reporting Be more constructive with your feedback

Comments

@coffee-cup
Copy link
Collaborator

If you have the transpiler setup and have

import { state } from "./model";

console.log(state.foo);

const myAction = () => {
  state.foo += 1;
}

you will get a runtime error say that you can't read foo of undefined. Instead of removing the state import after transpilation, we should keep it and make everything on the imported ctx a proxy that will show a nice error message.

@coffee-cup coffee-cup added the error reporting Be more constructive with your feedback label Sep 6, 2019
@coffee-cup coffee-cup mentioned this issue Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error reporting Be more constructive with your feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant