Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The requested module 'david' does not provide an export named 'getDependencies' #16

Closed
cedx opened this issue Jan 13, 2020 · 2 comments
Closed
Assignees
Labels
bug
Projects

Comments

@cedx
Copy link
Owner

@cedx cedx commented Jan 13, 2020

Using these tasks:

const {series, src, task} = require('gulp');

let david;
task('deps:check', () => src('package.json').pipe(david()));
task('deps:import', () => import('@cedx/gulp-david').then(mod => david = mod.david));
task('deps', series('deps:import', 'deps:check'));

I get the following error:

$ gulp deps
$ gulp deps
[21:51:06] Using gulpfile [...]\gulpfile.cjs
[21:51:06] Starting 'deps'...
[21:51:06] Starting 'deps:import'...
[21:51:06] 'deps:import' errored after 33 ms
[21:51:06] file:///C:/Projets/sab/cli/node_modules/@cedx/gulp-david/lib/checker.js:1
import { getDependencies, getUpdatedDependencies } from 'david';
         ^^^^^^^^^^^^^^^
SyntaxError: The requested module 'david' does not provide an export named 'getDependencies'
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
    at async Loader.import (internal/modules/esm/loader.js:141:24)
[21:51:06] 'deps' errored after 39 ms
@cedx cedx added the bug label Jan 13, 2020
@cedx cedx self-assigned this Jan 13, 2020
@cedx cedx added this to To do in Gulp-David via automation Jan 13, 2020
@cedx

This comment has been minimized.

Copy link
Owner Author

@cedx cedx commented Jan 13, 2020

Only the “default export” is supported for CommonJS files or packages 😢

import {DependencyMap, getDependencies, GetDependenciesFunction, GetDependenciesOptions, getUpdatedDependencies} from 'david';

@cedx

This comment has been minimized.

Copy link
Owner Author

@cedx cedx commented Jan 14, 2020

Fixed in version 13.1.0.

@cedx cedx closed this Jan 14, 2020
Gulp-David automation moved this from To do to Done Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Gulp-David
  
Done
1 participant
You can’t perform that action at this time.