framework7io / framework7-loader

MIT License
8 stars 7 forks source link

Error including partial: "TypeError: this.addDependency is not a function" #10

Closed ptoner closed 4 years ago

ptoner commented 4 years ago
{
  loader: 'framework7-component-loader',
  options: {
    helpersPath: './src/template7-helpers-list.js',
    partialsPath: './src/pages/',
    partialsExt: '.f7p.html'
  }
}

./src/pages/bars.f7p.html has a template.

I reference it in an f7.html file as {{> 'bars' }}.

The error I get when I build with webpack is:

TypeError: this.addDependency is not a function
    at module.exports (C:\Users\13309\repos\try-university\node_modules\framework7-component-loader\lib\get-partials.js:33:18)
    at Object.loader (C:\Users\13309\repos\try-university\node_modules\framework7-component-loader\lib\index.js:35:24)        
    at LOADER_EXECUTION (C:\Users\13309\repos\try-university\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
    at runSyncOrAsync (C:\Users\13309\repos\try-university\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
    at iterateNormalLoaders (C:\Users\13309\repos\try-university\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (C:\Users\13309\repos\try-university\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (C:\Users\13309\repos\try-university\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at C:\Users\13309\repos\try-university\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
    at C:\Users\13309\repos\try-university\node_modules\graceful-fs\graceful-fs.js:123:16

If I comment out the following line everything works fine.

https://github.com/framework7io/framework7-component-loader/blob/e1db25b03c99ba85a69076d61d8af683edef3302/lib/get-partials.js#L35

Could something be wrong with my setup?

ptoner commented 4 years ago

This doesn't happen for me on a different project. Thinking it might be something with my setup. Not sure what. But I guess I'll close the issue.