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

TypeError: proj.addSourceFileNew is not a function #1

Open
clarsen opened this issue Dec 14, 2018 · 1 comment
Open

TypeError: proj.addSourceFileNew is not a function #1

clarsen opened this issue Dec 14, 2018 · 1 comment

Comments

@clarsen
Copy link

clarsen commented Dec 14, 2018

Using [email protected] (which isn't pushed to your repo by the way 😄 )
Invoking react-native link react-native-swift results in the below.

Writing to  .../ios/RNPlaceholder.swift
.../node_modules/react-native-swift/bin/postlink.js:43
proj.addSourceFileNew(placeholder);
     ^

TypeError: proj.addSourceFileNew is not a function
    at Object.<anonymous> (.../node_modules/react-native-swift/bin/postlink.js:43:6)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
.../node_modules/react-native/local-cli/core/makeCommand.js:32
        throw new Error(`Error occurred during executing "${command}" command`);
        ^

Error: Error occurred during executing "node node_modules/react-native-swift/bin/postlink.js" command
    at ChildProcess.prelink (...2/node_modules/react-native/local-cli/core/makeCommand.js:32:15)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

I think you might be picking up the default/global installed 'xcode' via

var pbxproj = require("xcode");

instead of

var pbxproj = require('@raydeck/xcode');

In any case, making that patch stops the error.

@rhdeck
Copy link
Owner

rhdeck commented Dec 14, 2018

Thank you! Am in process of transitioning all my packages to use the scoped version of the Xcode pbxproj parser because of conflicts with RN. you found a hole. Committed patch and published to npm.

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