dokuzbir
Drab webpack problem - Uncaught ReferenceError: require is not defined
I am trying to use drab with webpack but i get error in drap.js
Uncaught ReferenceError: require is not defined
this.Socket = require("phoenix").Socket;
I tried to add that to in app.js
window.socket = require("phoenix").Socket
and i changed
this.Socket = window.socket
But get new error this.Socket is not a constructor. How can i use drab with webpack ?
Most Liked
grych
There is no better way to learn than contributing to an opensource project, IMO.
grych
Of course everyone is invited! More brains!
Don’t worry if you find it complicated. Some parts are, but you can always start with the easier stuff, then get deeper and help refactor the core code. I could suggest few areas to work with:
-
Issues: check the issues list, the ones marked with “help wanted” are waiting for you! There is one marked as “level: beginner”, should be quite easy to jump into.
-
Documentation: Drab is the software for developers, so documentation is at least the same important as the code. It needs review, clarification. There are for sure many parts which are understandable for me, but not for others. Also, starting with docs would let you learn how Drab works
-
Tutorial and examples: there is a page, Drab: Server Side User Interface Access, with few examples. It also could be improved, more interesting examples added. José suggested creating the example app with multiple chat rooms - maybe something like slack? - I think it is a good idea, but I never had time to do it. There is also a need to write a real beginners guide. I was even thinking about writing a complete beginners guide (with short introduction to elixir, phoenix, html and css). I want Drab to be a good way for beginners to start doing webapps without scary JS frameworks.
-
Code review: Drab started as a proof of concept, and had thousands of twists in its history. There is a lot to improve with code readability. Sometime I am wondering how does it works
Again, this would be a good exercise and way to learn how it works.
Zesky665
About the multi chat room tutorial, I’m doing something similar for my graduation thesis and I’m in the process or rebuilding it with drab. Would anyone be interested in a tutorial?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








