angular / material

Material design for AngularJS
https://material.angularjs.org/
MIT License
16.55k stars 3.39k forks source link

Doc not working a while complete offline #8949

Closed hanogin closed 8 years ago

hanogin commented 8 years ago

When i run the command "npm run watch" and open the browser on port 8080 a while i have an internet connection, everything is working just fine. But when i don't have an internet connection there is errors.

I look it up and i see that in the dist\docs\index.html file there is some https request. I try to download the requested file but then the "run watch" erase everything of course...

So i tried to run the index.html without the "run watch" command and there is other error....

So could you please help me to run this doc a while completely offline? And maybe could you update what need to be update so the doc would run a while completely offline - as this is the main point anyway.

Thanks

crisbeto commented 8 years ago

It should be because it references Angular from the CDN.

hanogin commented 8 years ago

I saw that and replace all of cdn to a local path and still errors. Any help on that?

Why can't it build to a real offline?

crisbeto commented 8 years ago

What error are you getting?

hanogin commented 8 years ago

OK so i after i build with the ''npm run watch'' and check that it's working a while online. I disconnected and run it again without change to local path and this is the error: Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-route.min.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED angular-material.min.js:13 Uncaught TypeError: Cannot read property 'module' of undefined docs.js:2 Uncaught ReferenceError: angular is not defined docs-demo-scripts.js:3 Uncaught ReferenceError: angular is not defined https://www.google-analytics.com/analytics.js Failed to load resource: net::ERR_NAME_NOT_R ESOLVED

Now, i change everything to local path and i get these error: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/angular-material.min.css Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/docs.css Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/preload.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/temp/angular/angular.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/temp/angular-animate/angular-animate.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/temp/angular-route/angular-route.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/temp/angular-aria/angular-aria.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/temp/angular-messages/angular-messages.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/angular-material.min.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/docs.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/docs-demo-scripts.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/img/icons/angular-logo.svg Failed to load resource: the server responded with a status of 404 (Not Found) https://www.google-analytics.com/analytics.js Failed to load resource: net::ERR_NAME_NOT_RESOLVED http://localhost:63342/temp/font.css Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/angular-material.min.css Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/docs.css Failed to load resource: the server responded with a status of 404 (Not Found) 

So i change the base href tfrom "base href="/" to base href="./"

And now something wired append, in chrome it took almost a minute to load it and it was load broken, the page was not working and it's stuck! This is the error i the console :Failed to clear temp storage: It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources. SecurityError"

By the way, i opened the docs folder (after i build it) in the webstorm so the index.html file is in the root.

crisbeto commented 8 years ago

Are you sure the script location is proper? For me it runs on port 8080 locally.

hanogin commented 8 years ago

OK, you right. I build, change to local path and it's working in port 8080.

Thank you very much.

But still why don't build it in the first place to work in a complete offline?

crisbeto commented 8 years ago

Most likely because it's easier to maintain and should be faster to serve Angular from the CDN.