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

expo build:web on expo-template-typescript generates extra /GeekyAnts/nativebase-templates/ in static and font links from index.html #44

Open
tianhuil opened this issue Apr 18, 2022 · 9 comments

Comments

@tianhuil
Copy link

To reproduce:

expo init my-app --template @native-base/expo-template-typescript
cd my-app
yarn install
expo build:web
python3 -m http.server 2021 --directory web-build. # somehow serve the static content

Loading 'localhost:2021, you'll get these errors:

Serving HTTP on :: port 2021 (http://[::]:2021/) ...
::1 - - [18/Apr/2022 10:26:46] "GET / HTTP/1.1" 200 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/static/js/runtime~app.396591f8.js HTTP/1.1" 404 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/static/js/2.15be5df1.chunk.js HTTP/1.1" 404 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/static/js/app.900ee758.chunk.js HTTP/1.1" 404 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/manifest.json HTTP/1.1" 404 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/favicon.ico HTTP/1.1" 404 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/favicon-32.png HTTP/1.1" 404 -
::1 - - [18/Apr/2022 10:26:46] code 404, message File not found
::1 - - [18/Apr/2022 10:26:46] "GET /GeekyAnts/nativebase-templates/favicon-16.png HTTP/1.1" 404 -

If you move the above 404 files from the web-build directory to web-build/GeekyAnts/nativebase-templates/, it will work properly. How do I get rid of the unnecessary /GeekyAnts/nativebase-templates/ in the links in index.html?

@tianhuil tianhuil changed the title expo build:web on expo-template-typescript generates extra /GeekyAnts/nativebase-templates/ in static and font files expo build:web on expo-template-typescript generates extra /GeekyAnts/nativebase-templates/ in static and font links from index.html Apr 18, 2022
@mauricel
Copy link

I had the same issue, have not been able to work out how to fix this.
The only thing I found that worked was to not use the template at all, and just install nativebase over an existing expo project.

@PunishedSnakePr
Copy link

@GeekyAnts: Please, please, fix this!!

@jshaw-decides
Copy link

I just ran into this about 30 minutes ago. I searched the index.html for href and all of them point to the /GeekyAnts/nativebase-templates folder.

I added this to my package.json to resolve the issue until I can look into what the real issue is (don't hold your breath).

"build:web": "mkdir GeekyAnts && mkdir GeekyAnts/nativebase-templates && expo build:web && cp -R web-build/* GeekyAnts/nativebase-templates && mv GeekyAnts web-build",

It works for now, but I'll come back if I run into any issues.

@gfviegas
Copy link

This GeekyAnts/nativebase-templates prefix is also applied in assets loaded on application code itself, such as fonts and images, for instance, using require().

Perhaps there is a base path config somewhere?

It's odd this prefix is nowhere to be found in my source code, even in the node_modules itself.

@jshaw-decides
Copy link

Right? I couldn't find where that's configured either.

@gfviegas
Copy link

@mogulx-operates @tianhuil @PunishedSnakePr

After much digging out I found out the problem!

Remove the homepage key in your package.json file. It seems the expo build read its content to create GH-Pages build aseets.

@ankit-tailor
Copy link
Contributor

Hi, I am unable to reproduce the issue. It would be great if you can provide your repo.

@didiercolo
Copy link

@ankit-tailor I had exactly the same issue described here.
How did I get this error:

  • I was following installation instructions from here: https://docs.nativebase.io/install-expo
  • Once I have my dev env running I tried to build the basic example by running expo build:web
  • After that I ran npx serve web-build
  • At this point, my local server had the issue

How did I solve the issue:
Simple by following @gfviegas steps

#44 (comment)

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

7 participants