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

Console Error with Mock Server and Module CDN #98

Open
1sd15 opened this issue Oct 4, 2024 · 1 comment
Open

Console Error with Mock Server and Module CDN #98

1sd15 opened this issue Oct 4, 2024 · 1 comment

Comments

@1sd15
Copy link

1sd15 commented Oct 4, 2024

Hey! First off I'd like to say that I love how the project has been presented and maintained. I hope to use it more soon!

I'm hitting a snag on my Codepen (https://codepen.io/1sd15/pen/zYgGYEZ) in which hitting the Mock Server gives me back Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'toString') originating from the statusKey method.

I believe that this could be due the Module CDN but it could also be a mistake I've overlooked. I'd love some assisstance if possible!

@imacrayon
Copy link
Owner

Hey! You'll get that error using an outdated version of the mock server. It looks like that Pen is including v0.9.1 of Alpine AJAX but only v0.2.0 for the server, as long as those version numbers match you should be good to go.

Thanks for bringing this to my attention though, the mock server could use some love, it's not the easiest thing to work with right now. I might try to get an update out this weekend.

Unfortunately, I'm not sure that the mock server code will play nice with ESM modules even after that version fix though. For the mock server to work routes need to be defined before the page's DOMContentLoaded event fires, and - if I remember correctly - I think module code runs after that event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants