dustjs icon indicating copy to clipboard operation
dustjs copied to clipboard

Lack of compile method when used with webpack

Open Olgagr opened this issue 7 years ago • 7 comments

I'm using dustjs-linkedin v. 2.7.2 with webpack. When I'm importing dust:

import * as Dust from 'dustjs-linkedin';

or

const Dust = require('dustjs-linkedin');

the imported object doesn't have compile method.

l_avenir

Is it something webpack specific ?

Olgagr avatar Apr 05 '17 16:04 Olgagr

After some more searching, I'm not the only one that have this problem with dustjs and webpack: http://stackoverflow.com/questions/37592861/dustjs-with-webpack-dont-load-all-files

I also tried to import index.js:

const dust = require('dustjs-linkedin/index.js')

but it gives errors:

Module not found: Error: Can't resolve 'dust.core' in '/Users/apple/Documents/my_projects/repos_arranger_client/node_modules/dustjs-linkedin/lib'
 @ ./~/dustjs-linkedin/lib/parser.js 4:4-6:6
 @ ./~/dustjs-linkedin/index.js
 @ ./src/app/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js

ERROR in ./~/dustjs-linkedin/lib/compiler.js
Module not found: Error: Can't resolve 'dust.core' in '/Users/apple/Documents/my_projects/repos_arranger_client/node_modules/dustjs-linkedin/lib'
 @ ./~/dustjs-linkedin/lib/compiler.js 3:4-5:6
 @ ./~/dustjs-linkedin/index.js
 @ ./src/app/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js

ERROR in ./~/dustjs-linkedin/lib/compiler.js
Module not found: Error: Can't resolve 'dust.parse' in '/Users/apple/Documents/my_projects/repos_arranger_client/node_modules/dustjs-linkedin/lib'
 @ ./~/dustjs-linkedin/lib/compiler.js 3:4-5:6
 @ ./~/dustjs-linkedin/index.js
 @ ./src/app/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js

I've also checked version 2.7.5. The same story. The only file that seems to be imported is lib/dust.js :(

Olgagr avatar Apr 05 '17 17:04 Olgagr

I have the same issue. Can't get a way to load dust as webpack module. Gives this error:

ERROR in ./~/dustjs-linkedin/lib/compiler.js
Module not found: Error: Can't resolve 'dust.parse' in '(blablabla)\node_modules\dustjs-linkedin\lib'
 @ ./~/dustjs-linkedin/lib/compiler.js 3:4-5:6
 @ ./spec/client/test-main.js

cidwel avatar May 17 '18 07:05 cidwel

try adding alias in webpack.config:

alias: { .... "dust.core": "dustjs-linkedin" }

batcoder1 avatar Nov 20 '18 07:11 batcoder1

try adding alias in webpack.config:

alias: { .... "dust.core": "dustjs-linkedin" }

i also have the same issue tried alias but did not worked

rkrishn avatar Dec 11 '18 07:12 rkrishn

@Olgagr do you got any solution ?

rkrishn avatar Dec 11 '18 09:12 rkrishn

@rkrishn Unfortunately, it was a long time ago. I don't remember what I did to make it work and I don't have an access to this project any more :( Sorry that I can't help more.

Olgagr avatar Dec 11 '18 10:12 Olgagr

@rkrishn Did you get the solution?I am also stuck on the same issue

amalbros avatar Mar 08 '21 09:03 amalbros