-
Notifications
You must be signed in to change notification settings - Fork 129
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
const IPFS=require('ipfs') in example.js caused compiling error #155
Comments
Hi @emclab . I have tested this on Android and it appears to work just fine. I am also not having a compilation issue with iOS, however it does cause a crash at runtime which I am looking into. As for the compilation issue, the log file will have some more information. Can you attach the log? You can find it in the Report Navigator and click on "Build". The log will show up on the right.
|
Here is the latest Build log. If this is not what you need, please let me know and I will post again. Thanks. Showing Recent Issues Build target liquidcore_bundle of project Pods with configuration Debug PhaseScriptExecution [CP-User]\ Bundle\ JavaScript\ Files /Users/zhouyiyun/Library/Developer/Xcode/DerivedData/nodejs_lc-fkjuwidrveevrcafkgowgmakqkmm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/liquidcore_bundle.build/Script-BD3FF46BF5FD239419567FF3FFB1A8A4.sh (in target 'liquidcore_bundle' from project 'Pods')
## ### #### ### ###### ######## ####### ########## ####### ######## ###### ### #### ### ##
Error: Unexpected token name «await», expected punc «(» in file node_modules/ipfs-utils/src/files/glob-source.js at 25:8 Build target nodejs_lc of project nodejs_lc with configuration Debug |
Here is the node_modules/ipfs-utils/src/files/glob-source.js: 'use strict' const fs = require('fs-extra') /**
async function * toGlobSource ({ path, type, prefix, mode, mtime, preserveMode, preserveMtime }, options) { const baseName = Path.basename(path) if (type === 'file') {
} if (type === 'dir' && !options.recursive) { const globOptions = Object.assign({}, options.glob, { for await (const p of glob(path, '**/*', globOptions)) {
} const toPosix = path => path.replace(/\/g, '/') |
HI @ericwlange, here is the post on ipfs with an answer which claims that part of toolchain does not support async/await |
Hi @emclab , Can you try to disable the minifier? Edit your "bundler_options": {
"minify": false
}, and let me know if that solves the problem? I have it turned off in my configuration and it is bundling fine. |
Hi ericwlange, the solution works. Thank you! I am still interested in working on react-native with LiquidCore. I know that the LC for RN you posted is only working for RN 0.57. If you have a procedure document for updating LC for RN , I may follow the document to update the LC for RN. Many thanks. |
Object.setPrototypeOf should return the set prototype, not `true` on success per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
Bumped version to 0.7.3 Use exactly metro version 0.57
This is now fixed in 0.7.3. I will close this issue and respond about RN in the other issue. |
My swift app requires nodejs module
ipfs
(yarn add ipfs under root subdir). The env is MacOS with Xcode 11.3. LiquidCore 0.7.2. Here is the package.json{
"name": "liquidcore_node",
"version": "1.0.0",
"description": "mobile nodejs",
"main": "index.js",
"scripts": {
"server": "node node_modules/liquidcore/lib/cli.js server",
"bundler": "node node_modules/liquidcore/lib/cli.js bundle",
"init": "node node_modules/liquidcore/lib/cli.js init",
"gradle-config": "node node_modules/liquidcore/lib/cli.js gradle",
"pod-config": "node node_modules/liquidcore/lib/cli.js pod",
"postinstall": "node node_modules/liquidcore/lib/cli.js postinstall"
},
"author": "Jun C.",
"license": "ISC",
"dependencies": {
"ipfs": "^0.41.2",
"liquidcore": "^0.7.2"
},
"liquidcore": {
"entry": [
"example.js"
],
"pod_options": {
"target": "nodejs_lc",
"podfile": "./"
},
"bundler_output": {
"ios": ".liquidcore/ios_bundle"
}
}
}
Here is the example.js:
const {LiquidCore} = require('liquidcore')
//const ipfs = await IPFS.create();
// A micro service will exit when it has nothing left to do. So to
// avoid a premature exit, set an indefinite timer. When we
// exit() later, the timer will get invalidated.
setInterval(()=>{}, 1000)
console.log('Hello, World!')
// Listen for a request from the host for the 'ping' event
LiquidCore.on( 'ping', () => {
// When we get the ping from the host, respond with "Hello, World!"
// and then exit.
const IPFS = require('ipfs'); //<<===this caused compiling error
})
// Ok, we are all set up. Let the host know we are ready to talk
LiquidCore.emit( 'pong', {message: "sent from LC example.js"} )
The compiling error is:
The error is:
liquidcore_bundle 1 issue
uncatgorized
Command PhaseScriptExecution failed with nonzero exit code
The code compiling is fine if commented out line of
ipfs
. What is missing here? I didn't find detail about how to add a nodejs module and assumed I could yarn add in project root directory.The text was updated successfully, but these errors were encountered: