Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Build issues using Expo EAS#764

Unanswered
jonlaing asked this question inQ&A
Discussion options

The problem

I was trying to build my Expo app which uses this package, and I was running into problems that weren't immediately obvious. After some sleuthing I eventually found this line in the Xcode error log.

Error loading assets JSON from Metro. Ensure you've followed all expo-updates installation steps correctly. Unable to resolve module rescript-react-native/src/apis/Style.bs.js from /Users/expo/workingdir/build/components/rescript /<mycomponent>.bs.js: rescript-react-native/src/apis/Style.bs.js could not be found within the project or in these directories:node_modules

What I eventually realized is that this package ships only with the*.res files, and you're expected to build the*.bs.js files yourself. Conversely, EAS installs yournode_modules fresh after upload during the build process, so none of those files get compiled on the EAS server.

Considered solution

I was able to fix it by adding the following to mypackage.json:

{// ..."scripts":{// ..."eas-build-post-install":"yarn rescript clean && yarn rescript build"}// ...}

This tells the EAS build system to build the rescript files after it runsyarn install (andpod install for iOS specifically).

I think the most straight forward solution is to just add this to the docs and on the website. Just save some people the headache of running into this problem and not being sure how to solve it.

Alternatives solutions

I guess the package could bundle*.bs.js files, but I don't know if that's even the right solution. I think a line in the docs is probably sufficient.

You must be logged in to vote

Replies: 1 comment

Comment options

MoOx
May 30, 2022
Maintainer

The problem is: the location (and content!) of the generated JS files depends on your ReScript (bsconfig.json) configuration, so we can't really provide a solid way for this kind of problem.
I guess something in the doc could help! You can make a quick PR here if you want:https://github.com/rescript-react-native/rescript-react-native.github.io/edit/src/docs/install.md

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@jonlaing@MoOx
Converted from issue

This discussion was converted from issue #763 on May 30, 2022 14:08.


[8]ページ先頭

©2009-2025 Movatter.jp