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

Bundle error. #36

Closed
ghost opened this issue Jan 14, 2021 · 4 comments
Closed

Bundle error. #36

ghost opened this issue Jan 14, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2021

IF i run command deno bundle https://deno.land/x/[email protected]/mod.ts aqua.js and run with local import - i see the error.
But if download repository and delete this lines in mod.ts -


import Aqua from "./aqua.ts";
export default Aqua;

can be run bundler locally - deno bundle mod.ts aqua.js and run again - everything works fine.
(warning - in deno 1.6.3 new bundler and there are often problems with it, i make bundle with 1.5.4 version)
You may find this observation useful

Спасибо!

@predetermined
Copy link
Owner

Could you tell me what you are using the Deno bundle command for? I don't quite get why you would bundle a server-side app

@ghost
Copy link
Author

ghost commented Jan 15, 2021

I work on the principle of frontend development. :-)
In a front we connect js like this: <script src="JS/main.js"></script>
Deno bundle command allows you to use a similar method:

  1. we run bundle and get a ready-made library, as if it is some kind of script on the frontend.
  2. next, we connect it in the main file: import { module } from './local_module.js'
    as a result, we get a project management structure similar to the frontend.

modules_folder
    aqua.js
    dndb.js
    djwt.js
    more_modules.js ...
    

I know this is not a common and not quite right method but it

  1. is very convenient for a beginner in the backend.
  2. I control all the code of the entire application without caching.

@predetermined
Copy link
Owner

predetermined commented Jan 15, 2021

I don't think there is an easy way of fixing it right now.
This bug has already been fixed in SWC (swc-project/swc#1264), but I think it hasn't landed in the Deno CLI yet.

Here's a workaround:
Use deno bundle https://deno.land/x/aqua@VERSION/aqua.ts aqua.js instead of deno bundle https://deno.land/x/aqua@VERSION/mod.ts aqua.js.

@ghost
Copy link
Author

ghost commented Jan 15, 2021

Спасибо!

@ghost ghost closed this as completed Jan 15, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant