-
Notifications
You must be signed in to change notification settings - Fork 6
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
ReferenceError: window is not defined #3
Comments
purescript-phoenix is meant to run in a client-side browser environment alongside the phoenix.js client library. However, the To get started with purescript-phoenix, the purescript code can be compiled into a single javascript file with the |
Thanks for following up. I copied
Then, in the javascript console I get the error:
So am I still not running alongside the |
If you are not using brunch (i.e. you created your phoenix project with <script src="<%= static_path(@conn, "/js/phoenix.js") %>"></script>
<script src="<%= static_path(@conn, "/js/main.js") %>"></script> If you are using brunch, you would need to incorporate your purescript code into the brunch build instead of directly including the global.Phoenix = require("phoenix");
require("./main"); |
I cannot run the example code. Am I missing something or is there an incompatibility with Purescript version 0.11.6?
To reproduce:
Create a new project with
pulp init && bower install purescript-phoenix
Copy the example code into
src/Main.purs
.When trying to run the example with
pulp run
I get the unexpected outputThe text was updated successfully, but these errors were encountered: