expo publish fails when using an absolute path

#1

Also posted in `https://stackoverflow.com/questions/52820669/expo-publish-fails-when-using-an-absolute-path

I am using expo-cli 2.1.2.

I have defined an absolute path in my .babelrc file as following:

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": [
          ["transform-react-jsx-source"],
          ["module-resolver", {
            "alias": {
              "abs": "./src",
            }
          }]
        ]
    }
  }
}

I am able to build and test with this file. However, when I try to publish, the metro bundler fails to resolve the absolute path:

Unable to resolve "abs/services/firebaseInit" from "App.js"

Where App.js is in the top directory, and the failure is for the following line:

import firebaseInit from 'mypet/services/firebaseInit';

(firebaseInit is defined in src\services\firebaseInit.js)

Any idea how to solve this?

1 Like
closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.