Adding "transpileDependencies" results to "export xxx was not found ..."



  • Hello,
    I am using version 0.17,
    Adding “transpileDependencies” , “quasar dev” causes error:

    "export 'filter' was not found in 'p-iteration'
    

    the code is here
    Any help is really appreciated



  • Hope this can help. You can try create a plugin file e.g: p-iteration.js

    import * as iteration from 'p-iteration';
    
    export default ({ Vue, store }) => {
      Vue.prototype.$iteration = store.$iteration = iteration;
    };
    

    At quasar.conf.js

        plugins: [
          'i18n',
          'axios',
          'p-iteration'
        ],
    

    At your Vue file

    await this.$iteration.filter(words, x => (x.length > 1));
    


  • Hi Teo, thank you for your answer.
    After applying your suggestion / code,
    there’s a different error:

    Uncaught ReferenceError: exports is not defined
        at eval (webpack-internal:///./node_modules/p-iteration/lib/static-methods.js:20)
        at Module../node_modules/p-iteration/lib/static-methods.js (app.js:3913)
        at __webpack_require__ (app.js:768)
        at fn (app.js:131)
        at Module.eval (webpack-internal:///./node_modules/p-iteration/index.js:6)
        at eval (webpack-internal:///./node_modules/p-iteration/index.js:13)
        at Module../node_modules/p-iteration/index.js (app.js:3889)
        at __webpack_require__ (app.js:768)
        at fn (app.js:131)
        at eval (webpack-internal:///./src/plugins/p-iteration.js:2)
    

Log in to reply