NicolasCARPi / dropzone

Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
http://www.dropzone.dev/js
Other
36 stars 3 forks source link

Build a dist #2

Closed Xavlight closed 2 months ago

Xavlight commented 2 months ago

Hi, I'd like to create a Build to use it in Standalone mode (js and css). I made :

But creating the Buil fails. Can you help me?

Thanks

Xav

NicolasCARPi commented 2 months ago

Hello,

But creating the Buil fails.

You'll want to share the specific problem, rather than a very generic "fails".

Can you help me?

With the level of information you provided, no.

Xavlight commented 2 months ago

Hi, On my project, I'm using dropzone.js and dropzone.min.css in version 5.9.3 It works correctly, with a few modifications that I've integrated into the js (resize problem). I'd like to use version 7 but with my Browser JS mode code, I need to have compiled versions.

npm install
npm audit fix

# npm audit report
minimist  <=0.2.3
Severity: critical
Prototype Pollution in minimist - https://github.com/advisories/GHSA-vh95-rmgr-6w4m
Prototype Pollution in minimist - https://github.com/advisories/GHSA-xvch-5gv4-984h
fix available via `npm audit fix`
node_modules/optimist/node_modules/minimist
  optimist  >=0.6.0
  Depends on vulnerable versions of minimist
  node_modules/optimist

node-static  *
Severity: high
Denial of Service in node-static - https://github.com/advisories/GHSA-8r4g-cg4m-x23c
node-static and @nubosoftware/node-static vulnerable to Directory Traversal - https://github.com/advisories/GHSA-5g97-whc9-8g7j
No fix available
node_modules/node-static

3 vulnerabilities (1 moderate, 1 high, 1 critical)
Some issues need review, and may require choosing a different dependency.`

npm build
`> @deltablot/dropzone@7.0.0 build
> parcel build && yarn run css
× Build failed.
Error: The expression evaluated to a falsy value:
  (0, _assert().default)(bundleGraph instanceof _BundleGraph.default)
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    (0, _assert().default)(bundleGraph instanceof _BundleGraph.default)
      at Object.runPackage
  (d:\xampp\htdocs\vs-lead\dropzone-7.0.0\node_modules\parcel\node_modules\@parcel\core\lib\worker.js:134:25)
      at Child.handleRequest (d:\xampp\htdocs\vs-lead\dropzone-7.0.0\node_modules\@parcel\workers\lib\child.js:203:34)
      at Child.messageListener (d:\xampp\htdocs\vs-lead\dropzone-7.0.0\node_modules\@parcel\workers\lib\child.js:94:19)
      at ThreadsChild.onMessage (d:\xampp\htdocs\vs-lead\dropzone-7.0.0\node_modules\@parcel\workers\lib\child.js:67:12)
      at ThreadsChild.handleMessage
  (d:\xampp\htdocs\vs-lead\dropzone-7.0.0\node_modules\@parcel\workers\lib\threads\ThreadsChild.js:42:10)
      at MessagePort.<anonymous>
  (d:\xampp\htdocs\vs-lead\dropzone-7.0.0\node_modules\@parcel\workers\lib\threads\ThreadsChild.js:38:61)
      at [nodejs.internal.kHybridDispatch] (node:internal/event_target:737:20)
      at exports.emitMessage (node:internal/per_context/messageport:23:28)

I'm not an expert, and I'm not capable of understanding the problem.

If you can help me. Thanks

Xav

NicolasCARPi commented 2 months ago

It seems you are hitting this Parcel bug: https://github.com/parcel-bundler/parcel/issues/8716. Which seems unfixed. No idea why it happens.

But you don't need to build it yourself, as npm ships the built files in the dist folder. See: https://cdn.jsdelivr.net/npm/@deltablot/dropzone@7.0.2/dist/

If you do npm install @deltablot/dropzone you'll have the files in node_modules/@deltablot/dropzone/dist/.

Also, given that it is a yarn project, you should use yarn install and then yarn build instead of npm.

I'm not an expert

That's fine, but when you report an issue you need to give all relevant informations immediatly. I'll look into adding a bug report template, but in the mean time: https://testlio.com/blog/the-ideal-bug-report/

NicolasCARPi commented 2 months ago

Try with 7.0.4, I've updated the dependencies, it might help. https://github.com/NicolasCARPi/dropzone/releases/tag/7.0.4

Xavlight commented 2 months ago

Hi, I'm using the browser's native javascript and I don't have node.js (no import or require possible). OS System Windows

I don't think I can integrate the new JS. I use the JS 5.9.3 library of this type. https://cdn.jsdelivr.net/npm/dropzone@5.9.3/dist/dropzone.js When I put the new one from your dist link, it gives me an error that 'require' is not defined.

Thanks

Xav

NicolasCARPi commented 2 months ago

Try with this file: https://cdn.jsdelivr.net/npm/@deltablot/dropzone@7.0.4/dist/dropzone-min.js

edit

Use the minified one: https://cdn.jsdelivr.net/npm/@deltablot/dropzone@7.0.4/dist/dropzone-min.js

I didn't really change anything related to how the code is loading, so you should be able to use it like before. There are no breaking changes. But I realize now you probably need to use the minified one (ends with -min.js).

Xavlight commented 2 months ago

Ok I try it.

Thanks