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

Error on SSR projects with actions execution #45

Closed
dipiash opened this issue Jul 9, 2020 · 4 comments
Closed

Error on SSR projects with actions execution #45

dipiash opened this issue Jul 9, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@dipiash
Copy link
Contributor

dipiash commented Jul 9, 2020

Now I see that source code in tag v3.0.2 (https://github.com/bluebill1049/little-state-machine/releases/tag/v3.0.2), doesn't contain changes for middleware.

In archive:

export const middleWare = (data: string = '') => {
  if (data) {
    // @ts-ignore
    window[STORE_ACTION_NAME] = data;
  }
  return data;
};
...
 if (isDevMode) {
    middleWare(debugName);
  }

...

and when I execute action on Server Side I have an error:

ReferenceError: window is not defined
    at middleWare (/ssr/node_modules/little-state-machine/dist/little-state-machine.js:125:9)
    at Object.updateUserData (/ssr/node_modules/little-state-machine/dist/little-state-machine.js:163:9)
@bluebill1049 bluebill1049 added the bug Something isn't working label Jul 9, 2020
@bluebill1049
Copy link
Member

you happy to submit a PR on this?

@dipiash
Copy link
Contributor Author

dipiash commented Jul 9, 2020

Yes I can

@dipiash
Copy link
Contributor Author

dipiash commented Jul 9, 2020

Can you publish new version?

@bluebill1049
Copy link
Member

done.

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

2 participants