Deno: Lodash-es 4.17.15 (from Pika.dev) broken in Deno 1.1.0 but works fine in 1.0.5

Created on 13 Jun 2020  路  12Comments  路  Source: denoland/deno

The lodash-es 4.17.15 module from Pika.dev works in Deno 1.0.5 but in 1.1 it is no longer working.

Given the following source:

import * as lodash from "https://cdn.pika.dev/lodash-es@^4.17.15";

console.log(Object.keys(lodash));

Produces 2000+ errors like the following:

TS2304 [ERROR]: Cannot find name 'PropertyPath'.
        property<TObj, TResult>(path: PropertyPath): (obj: TObj) => TResult;
                                      ~~~~~~~~~~~~
    at https://cdn.pika.dev/-/[email protected]/dist=es2019,mode=types/common/util.d.ts:1032:39

TS2304 [ERROR]: Cannot find name 'PropertyPath'.
        propertyOf<T extends {}>(object: T): (path: PropertyPath) => any;
                                                    ~~~~~~~~~~~~
    at https://cdn.pika.dev/-/[email protected]/dist=es2019,mode=types/common/util.d.ts:1059:53

TS2304 [ERROR]: Cannot find name 'PropertyPath'.
        propertyOf(): LoDashImplicitWrapper<(path: PropertyPath) => any>;
                                                   ~~~~~~~~~~~~
    at https://cdn.pika.dev/-/[email protected]/dist=es2019,mode=types/common/util.d.ts:1066:52

TS2304 [ERROR]: Cannot find name 'PropertyPath'.
        propertyOf(): LoDashExplicitWrapper<(path: PropertyPath) => any>;
                                                   ~~~~~~~~~~~~
    at https://cdn.pika.dev/-/[email protected]/dist=es2019,mode=types/common/util.d.ts:1073:52

TS2498 [ERROR]: Module '"https://cdn.pika.dev/-/[email protected]/dist=es2019,mode=types/index"' uses 'export =' and cannot be used with 'export *'.
export * from '/-/[email protected]/dist=es2019,mode=types/index.d.ts';
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://cdn.pika.dev/lodash/dist=es2019,mode=types/index.d.ts:23:15

Found 2073 errors.
bug cli

Most helpful comment

I have a similar issue with pika imports, but when I'm loading from raw source url, it works just fine:

import * as _  from 'https://raw.githubusercontent.com/lodash/lodash/4.17.15-es/lodash.js';

All 12 comments

May be related to what is happening in https://github.com/denoland/deno/issues/6133

@frankhale can you provide debug output from both cases (deno run -Ldebug)?

Here is the Deno 1.0.5 output:

deno-1.0.5-lodash-es-debug-output.txt

Here is the Deno 1.1.0 output:

deno-1.1.0-lodash-es-debug-output.txt

@frankhale thanks, it really hard to spot the problem with such big output. Have you experienced the same issue with other lodash imports, eg. importing single module also leads to such problems?

EDIT: Btw it seems that 1.0.5 version uses already cached files. Make sure to run with --reload flag to get repeatable results

EDIT: Btw it seems that 1.0.5 version uses already cached files. Make sure to run with --reload flag to get repeatable results

Oh okay. I had no idea it was doing that. I am still very new to Deno. I will try with --reload.

I ran it with Deno 1.0.5 and --reload flag and it worked as expected.

I'm surprised that there are not others complaining about other modules not working. Lodash did not change between Deno 1.0.5 and 1.1.0. I've been monitoring the issues but literally nobody else is complaining. Does anyone know what is actually going on here? I don't.

I have a similar issue with pika imports, but when I'm loading from raw source url, it works just fine:

import * as _  from 'https://raw.githubusercontent.com/lodash/lodash/4.17.15-es/lodash.js';

I'm guessing this was introduced in 4b7d3b060e88c02bc0ca12664f52111a4666b167 or db70b77e4b6a24814e0045f7f6afcf77730878a7

@uchm4n yes that does work. Thank you!

Since @uchm4n posted a work around I'm chalking this up as a problem with Pika.dev.

The lodash-es package from unpkg seems to work as well. As of Deno 1.1.3 the Pika.dev package still has the same behavior as listed above.

working lodash-es CDN:

https://unpkg.com/[email protected]/lodash.js

Was this page helpful?
5 / 5 - 1 ratings

Related issues

xueqingxiao picture xueqingxiao  路  3Comments

CruxCv picture CruxCv  路  3Comments

davidbarratt picture davidbarratt  路  3Comments

somombo picture somombo  路  3Comments

ry picture ry  路  3Comments