[
https://issues.apache.org/jira/browse/ARTEMIS-5569?focusedWorklogId=976919&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-976919
]
ASF GitHub Bot logged work on ARTEMIS-5569:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 30/Jul/25 11:45
Start Date: 30/Jul/25 11:45
Worklog Time Spent: 10m
Work Description: grgrzybek commented on PR #109:
URL:
https://github.com/apache/activemq-artemis-console/pull/109#issuecomment-3135931424
Actually it's not about rm-rfing `node_modules`. When working on
dependencies/devDependencies/peerDependencies I used some hacks to verify if
the bundlers are properly configured.
We have (here and in Hawtio too) two bundlers:
* tsup (esbuild + rollup) for _libraries_
* webpack for _apps_
The point is to not let duplicate code to sneak in anywhere.
For this purpose I check `tsup` produced file by filtering the bundle by
`^//` - it should _never_ contain any node_modules references. Here I see:
```
$ pwd
/home/ggrzybek/sources/github.com/apache/activemq-artemis-console/artemis-console-extension/artemis-extension/packages/artemis-console-plugin
✔
~/sources/github.com/apache/activemq-artemis-console/artemis-console-extension/artemis-extension/packages/artemis-console-plugin
[ggrzybek-console-fixes L|✚ 1]
13:38 $ grep '^//' dist/index.js
// src/globals.ts
// src/util/jmx.ts
// src/config-manager.ts
// src/artemis-service.ts
// src/artemis-preferences-service.ts
// src/table/ArtemisTable.tsx
// src/producers/ProducerTable.tsx
// src/consumers/ConsumerTable.tsx
// src/connections/ConnectionsTable.tsx
// src/sessions/SessionsTable.tsx
// src/queues/CreateQueue.tsx
// src/context.ts
// src/addresses/CreateAddress.tsx
//
../../node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js
// ../../node_modules/state-local/lib/es/state-local.js
// ../../node_modules/@monaco-editor/loader/lib/es/config/index.js
// ../../node_modules/@monaco-editor/loader/lib/es/utils/curry.js
// ../../node_modules/@monaco-editor/loader/lib/es/utils/isObject.js
// ../../node_modules/@monaco-editor/loader/lib/es/validators/index.js
// ../../node_modules/@monaco-editor/loader/lib/es/utils/compose.js
// ../../node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js
// ../../node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js
// ../../node_modules/@monaco-editor/loader/lib/es/loader/index.js
// ../../node_modules/@monaco-editor/loader/lib/es/index.js
// ../../node_modules/@monaco-editor/react/dist/index.mjs
// src/messages/SendMessage.tsx
// src/addresses/AddressesTable.tsx
// src/status/Status.tsx
// src/queues/QueuesTable.tsx
// src/messages/QueueSelect.tsx
// src/messages/MessagesTable.tsx
// src/messages/MessageView.tsx
// src/queues/QueuesView.tsx
// src/brokers/BrokerDiagram.tsx
// src/views/ArtemisTabView.tsx
// src/Artemis.tsx
// src/ArtemisTreeView.css
// src/ArtemisTreeView.tsx
// src/artemisJMX.css
// src/ArtemisJMXContent.css
// src/addresses/DeleteAddress.tsx
// src/queues/DeleteQueue.tsx
// src/views/ArtemisJMXTabView.tsx
// src/ArtemisJMXContent.tsx
// src/ArtemisJMX.tsx
// src/ArtemisPreferences.tsx
// src/ArtemisHeader.tsx
// src/plugin-ui.ts
// src/index.ts
// src/help.md
// src/index.ts
// Annotate the CommonJS export names for ESM import in node:
//# sourceMappingURL=index.js.map
```
which means that `tsup` didn't find:
* @monaco-editor/loader
* @monaco-editor/react
* state-local
modules among dependencies, so `tsup` simply put the source into target
bundle.
For webpack it's a bit more complicated, as we have chunks etc. But I simply
open the files in Gvim and do `:v/!\*\*\*.*node_modules/d` which gives me
something like:
```
!*** ../node_modules/@babel/runtime/helpers/esm/extends.js ***!
!*** ../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***!
!***
../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
!*** ../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
!*** ../node_modules/d3-axis/src/axis.js ***!
!*** ../node_modules/d3-axis/src/identity.js ***!
!*** ../node_modules/d3-axis/src/index.js ***!
!*** ../node_modules/d3-brush/src/brush.js ***!
!*** ../node_modules/d3-brush/src/constant.js ***!
...
(2405 lines like this)
```
Mind that this is the final bundle and it should contain everything -
including `node_modules` references. But these cryptic "module names" are
related to how Webpack works. Here I check if there are no weird
`../../../../../node_modules` which may be (but doesn't have to be) a sign that
there's something wrong.
Issue Time Tracking
-------------------
Worklog Id: (was: 976919)
Time Spent: 4h 10m (was: 4h)
> Cannot send message through console
> -----------------------------------
>
> Key: ARTEMIS-5569
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5569
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Web Console
> Affects Versions: console-1.2.1
> Reporter: Gašper Čefarin
> Priority: Blocker
> Labels: pull-request-available
> Attachments: image-2025-07-08-14-06-50-767.png,
> image-2025-07-08-14-08-49-445.png, image-2025-07-08-14-10-27-916.png
>
> Time Spent: 4h 10m
> Remaining Estimate: 0h
>
> I don't know when the bug appeared, I think this functionality worked in
> console 1.1.0.
> Currently, the frontend does not render properly and it's impossible to send
> a message through console.
> !image-2025-07-08-14-08-49-445.png!
>
> !image-2025-07-08-14-10-27-916.png!
> The problem is loading
> “[https://cdn.jsdelivr.net/npm/[email protected]/min/vs/loader.js]” and
> CSP policy.
>
> !image-2025-07-08-14-06-50-767.png!
>
> Commenting out this filter in /console.war/WEB-INF/web.xml works for me.
> {code:java}
> <!--
> <filter>
> <filter-name>ContentSecurityPolicyFilter</filter-name>
>
> <filter-class>io.hawt.web.filters.ContentSecurityPolicyFilter</filter-class>
> </filter>
> <filter-mapping>
> <filter-name>ContentSecurityPolicyFilter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> -->{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact