AKSW / building-navigator

The Gebäude-Navigator helps you to find accessible places in Leipzig.
https://behindertenverband-leipzig.de/gebaeude-navigator
GNU General Public License v3.0
3 stars 2 forks source link

Using just the dist-folder isn't working (BuildingNavigator is not defined) #19

Closed k00ni closed 7 years ago

k00ni commented 7 years ago

I copied the dist folder to my webhosting and wanted to use the index.html. But after calling it in the browser i ran into the following exceptions:

Uncaught Invariant Violation: Minified React error #37; 
visit http://facebook.github.io/react/docs/error-decoder.html?invariant=37 
for the full message or use the non-minified dev environment for full 
errors and additional helpful warnings.

Uncaught ReferenceError: BuildingNavigator is not defined

Generated main.min.js does NOT contain BuildingNavigator. Any idea?

screenshot from 2017-01-10 15 48 24

simeonackermann commented 7 years ago

Should solved with latest commit 17e6db35d075ec5938368184a07ac1c5eefa519f (it was an old main.min.js)

k00ni commented 7 years ago

Do you update dist/main.min.js on file changes or do i have to do that manually?

simeonackermann commented 7 years ago

I have do do it manually.

Am 10.01.2017 um 16:44 schrieb Konrad Abicht:

Do you update |dist/main.min.js| on file changes or do i have to do that manually?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/AKSW/building-navigator/issues/19#issuecomment-271610173, or mute the thread https://github.com/notifications/unsubscribe-auth/AGIWOXZ06jMPBQ-zy13ZXr94PogQwx3Eks5rQ6d4gaJpZM4Lff1h.

k00ni commented 7 years ago

Many steps neccessary? Can we move that into a Makefile or something to reduce the time load?

simeonackermann commented 7 years ago

It's just one webpack call with some parameters. To simplify we can put them into the npm packages file and call it e.g. npm build But I don't think it's a good idea the recreate the dist with each new commit

Am 16. Januar 2017 11:05:10 MEZ schrieb Konrad Abicht notifications@github.com:

Are there many steps? Can we move that into a Makefile or something to reduce the time load?

-- You are receiving this because you were assigned. Reply to this email directly or view it on GitHub: https://github.com/AKSW/building-navigator/issues/19#issuecomment-272819962

-- Diese Nachricht wurde von meinem CyanogenMod Android-Mobiltelefon mit K-9 Mail gesendet.

k00ni commented 7 years ago

But I don't think it's a good idea the recreate the dist with each new commit

Why not? The dist folder should be valid and contain the latest changes. If we want to carry out packages, which update only after days/weeks/months ... we could use Github's release section. But i wanted to use the dist from the beginning, to be able to try out the app without any further work.

Could you sketch here how it should work to update dist-folder manually, by calling like make update-dist. On each Git commit sounds hard to implement.

simeonackermann commented 7 years ago

https://github.com/AKSW/building-navigator/commit/177bf27902bcf514ed7b570cf1f75fa14a73b6ec implements command npm build-dist. It has to executed in the running Docker container.

k00ni commented 7 years ago

Thanks! Will look into it.

k00ni commented 7 years ago

Please use this for round 3.

package.json:

"devDependencies": {
        ...
        "write-file-webpack-plugin": "*"
    }

webpack.config.json:

...
var WriteFilePlugin = require('write-file-webpack-plugin');

module.exports = {
    ...
    output: {
        ...
    },
    plugins: [
        new WriteFilePlugin() // plugin to write compiled JS into dist folder
    ],
    ...
}
simeonackermann commented 7 years ago

As I pointed out the disadvantages of using WriteFilePlugin (esp. js min size) we may close this issue?

To build dist on each commit/push we can create a pre-push hook as a reminder or programmatically create dist and append to commit.

k00ni commented 7 years ago

As we decided we use two configurations, dev and prod, for future releases.