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

Error while setting up stylus #18

Closed
trialsNow opened this issue Nov 29, 2018 · 10 comments
Closed

Error while setting up stylus #18

trialsNow opened this issue Nov 29, 2018 · 10 comments

Comments

@trialsNow
Copy link

Any ideas?? Please help.
I followed the instructions in "react-native-css-modules/docs/setup-stylus.md"

While starting my app, it errors like this. It was working till I made all that setup and added .styl.

Error in Bundler console:
Cant start index.js. error
BUNDLE [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)::1 - - [29/Nov/2018:00:57:53 +0000] "GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.1" 200 - "-" "Mobile/1 CFNetwork/974.2.1 Darwin/17.7.0" error: bundling failed: TypeError: transform is not a function

Stack trace
Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(/Users/XXX/Documents/mobileXXX/index.js: transform is not a function (null))

__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.248
    RCTCxxBridge.mm:429
___ZL36attemptAsynchronousLoadOfBundleAtURLP5NSURLU13block_pointerFvP18RCTLoadingProgressEU13block_pointerFvP7NSErrorP9RCTSourceE_block_invoke.118
__80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke
-[RCTMultipartStreamReader emitChunk:headers:callback:done:]
-[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:]
-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]
__88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke
__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
-[NSBlockOperation main]
-[__NSOperationInternal _start:]
_dispatch_client_callout
_dispatch_block_invoke_direct
_dispatch_client_callout
_dispatch_block_invoke_direct
dispatch_block_perform
__NSOQSchedule_f
_dispatch_client_callout
_dispatch_continuation_pop
_dispatch_async_redirect_invoke
_dispatch_root_queue_drain
_dispatch_worker_thread3
_pthread_wqthread
start_wqthread
```
@kristerkari
Copy link
Owner

Thanks @trialsNow, which version of React Native are you using?

@trialsNow
Copy link
Author

trialsNow commented Nov 29, 2018

Thanks @kristerkari it is "react-native": "0.57.0"

@kristerkari
Copy link
Owner

hmm.. that's weird.

Would it be possible for you to upload your project somewhere where I could have a look at it? It's very hard for me to debug the problem without seeing the project setup :)

@trialsNow
Copy link
Author

trialsNow commented Nov 29, 2018

@kristerkari Its a huge project, I will create a sample and put down.
Attached my configs.. please let me know if I missed something.

Archive.zip

@kristerkari
Copy link
Owner

Thanks! I'll check out the configs and see if something is missing.

@trialsNow
Copy link
Author

@kristerkari Thanks
Is there anything I do in my Xcode like linking some libs to make this work?

@kristerkari
Copy link
Owner

Is there anything I do in my Xcode like linking some libs to make this work?

Nope, the project does not use any native code, so linking is not needed.

@kristerkari
Copy link
Owner

@trialsNow

I created a new repo with a fresh v0.57.0 React Native app + the config files that you provided + .babelrc changes + an example App.styl file:
kristerkari/css-mod-stylus-setup@16d7b67

Everything seems to work normally, so the error that you are getting has to be coming from somewhere else than the config files.

@trialsNow
Copy link
Author

@kristerkari
Thanks for looking at this.I resolved it. I added metro-config 0.49.X version in my package.json manually and installed them. Looks like react native would like its own metro bundler. I replaced all metro folders from my old project and now it works good (I mean I still have issues with my code :) but got past this problem)

Appreciate your quick response. Hoping to get your help as I progress through the stylus.

@kristerkari
Copy link
Owner

great, just let me know if you run into any issues related to CSS modules / Stylus. 👍

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

2 participants