Field 'browser' doesn't contain a valid alias configuration

后端 未结 16 2263
无人共我
无人共我 2020-12-01 11:54

I\'ve started using webpack2 (to be precise, v2.3.2) and after re-creating my config I keep running into an issue I can\'t seem to solve I get (sorry in advance

相关标签:
16条回答
  • 2020-12-01 12:08

    I'm using "@google-cloud/translate": "^5.1.4" and was truggling with this issue, until I tried this:

    I opened google-gax\build\src\operationsClient.js file and changed

    const configData = require('./operations_client_config');
    

    to

    const configData = require('./operations_client_config.json');
    

    which solved the error

    ERROR in ./node_modules/google-gax/build/src/operationsClient.js Module not found: Error: Can't resolve './operations_client_config' in 'C:\..\Projects\qaymni\node_modules\google-gax\build\src' resolve './operations_client_config' ......
    

    I hope it helps someone

    0 讨论(0)
  • 2020-12-01 12:12

    For anyone building an ionic app and trying to upload it. Make sure you added at least one platform to the app. Otherwise you will get this error.

    0 讨论(0)
  • 2020-12-01 12:14

    Turned out to be an issue with Webpack just not resolving an import - talk about horrible horrible error messages :(

    // Had to change
    import DoISuportIt from 'components/DoISuportIt';
    
    // To (notice the missing `./`)
    import DoISuportIt from './components/DoISuportIt';
    
    0 讨论(0)
  • 2020-12-01 12:14

    Changed my entry to

    entry: path.resolve(__dirname, './src/js/index.js'),
    

    and it worked.

    0 讨论(0)
  • 2020-12-01 12:16

    In my case, it was due to a broken sym link when trying to npm link a custom angular library to consuming app. After running npm link @authoring/canvas

    ```"@authoring/canvas": "path/to/ui-authoring-canvas/dist"``

    It appear everything was OK but the module still couldn't be found:

    When I corrected the import statement to something that the editor could find Link:

    import {CirclePackComponent} from '@authoring/canvas/lib/circle-pack/circle-pack.component';

    I received this which is mention in the overflow thread:

    To fix this I had to:

    1. cd /usr/local/lib/node_modules/packageName
    2. cd ..
    3. rm -rf packageName
    4. In the root directory of the library, run: a. rm -rf dist b. npm run build c. cd dist d. npm link

    5. In the consuming app, update the package.json with "packageName":"file:/path/to/local/node_module/packageName""

    6. In the root directory of the consuming app run npm link packageName

    0 讨论(0)
  • 2020-12-01 12:16

    Add this to your package.json:

    "browser": {
      "[module-name]": false   
    },
    
    0 讨论(0)
提交回复
热议问题