Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

TypeError: prepack.prepack is not a function #2

Open
wolfson-rebel opened this issue Dec 12, 2019 · 8 comments
Open

TypeError: prepack.prepack is not a function #2

wolfson-rebel opened this issue Dec 12, 2019 · 8 comments

Comments

@wolfson-rebel
Copy link

First of all, thank you for this module. Could save the time as soon as we figure out the reason, why it crashes with the followin error:

TypeError: prepack.prepack is not a function
at
node_modules\purgecss-from-js\lib\purgejs.js:37:35

Please, advice ^_^

@andysaman
Copy link

Same issue here. Haven't found a workaround

@kubal5003
Copy link

I have the same. I was looking into it and it looks like the contents of the package on npm are broken.

It's trying to execute prepack.prepack on content parameter of the extract function. It doesn't really make sense, so I'm assuming the problem is in publishing the latest codebase to npm.

@kubal5003
Copy link

@alinaish or @Ffloriel would you be able to publish version 1.0.0 (the current codebase that is using esprima) to npm?
I would hate to have to clone this and publish under different name without any significant contribution.

@Ffloriel
Copy link
Member

Yep, prepack was used on the previous version. The current codebase was not published. Will do now, thanks for the ping

@kubal5003
Copy link

Awesome, thank you!

@jacobq
Copy link

jacobq commented May 21, 2020

Does this work for anyone? I am still seeing an empty object for the default export/import.

npm info
$ npm info purgecss-from-js

[email protected] | ISC | deps: 1 | versions: 2
Extractor for js files
https://github.com/FullHuman/purgecss-from-js#readme

keywords: purgecss-from, purgecss, selectors, css, js

dist
.tarball: https://registry.npmjs.org/purgecss-from-js/-/purgecss-from-js-1.0.0.tgz
.shasum: fb075b596b79857860a69c00ab5087f2718b82dd
.integrity: sha512-sTs61vO7gOl3irS8L0WmiadY+YAESMIfKqUd67SRdzVov2udevSEgMyPCgzfLbtxnGJxxeObR2FJ4CfPf2T6Cg==
.unpackedSize: 140.9 kB

dependencies:
esprima: ^4.0.1

maintainers:
- ffloriel <[email protected]>
- jsnanigans <[email protected]>

dist-tags:
latest: 1.0.0

published a month ago by ffloriel <[email protected]>
> var p = require('purgecss-from-js')
undefined
> p
{}
> typeof p
'object'
> Object.entries(p)
[]

When I go back to the old (v0.1.0) release I see a function like I expect:

> require('purgecss-from-js')
[Function: PurgeFromJs]

@kubal5003
Copy link

Sorry, I'm just using a modified source version, so didn't have a chance to verify the new package.

@jansesun
Copy link

Does this work for anyone? I am still seeing an empty object for the default export/import.

npm info

> var p = require('purgecss-from-js')
undefined
> p
{}
> typeof p
'object'
> Object.entries(p)
[]

When I go back to the old (v0.1.0) release I see a function like I expect:

> require('purgecss-from-js')
[Function: PurgeFromJs]

I have the same problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants