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

part(Component) fails with error when the component is imported #1736

Open
rickmcgeer opened this issue Mar 4, 2025 · 1 comment
Open

part(Component) fails with error when the component is imported #1736

rickmcgeer opened this issue Mar 4, 2025 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@rickmcgeer
Copy link
Collaborator

Describe the bug
I have a commented line

// part(GalyleoDashboardStudio).openInWorld()

in

$world.execCommand("open browser", {moduleName: "studio/index.js", packageName: "engageLively--galyleo-dashboard", codeEntity: "main"});

The imports to that file are:

import { part, config } from 'lively.morphic';
import { LivelyWorld } from 'lively.ide/world.js';
import { GalyleoStudioWorld } from './ui.cp.js';

evaluating that string in that file produces this error:

TypeError: Cannot read properties of undefined (reading 'isPolicy')

    at Window.part (http://localhost:9011/projects/__rootModule___commonjs-entry-b3736275.js:58850:34)
    at Text.eval (http://localhost:9011/local_projects/engageLively--galyleo-dashboard/studio/index.js_doit_1741062218203:6:66)
    at eval (http://localhost:9011/local_projects/engageLively--galyleo-dashboard/studio/index.js_doit_1741062218203:11:4)
    at Text._eval (eval at <anonymous> (http://localhost:9011/projects/__rootModule___commonjs-entry-b3736275.js:1437:16), <anonymous>:2:10)
    at http://localhost:9011/projects/index-d538971d.js:2408:51
    at Object.runEval (http://localhost:9011/projects/index-d538971d.js:2887:22)
    at Object.runEval (http://localhost:9011/projects/index-d538971d.js:3748:104)
    at LocalCoreInterface.LocalCoreInterface_runEval_ (http://localhost:9011/projects/ui.cp-3cd94f75.js:3236:42)
    at Interface.Interface_runEval_ (http://localhost:9011/projects/ui.cp-3cd94f75.js:4123:39)
    at JavaScriptEditorPlugin.JavaScriptEditorPlugin_runEval_ (http://localhost:9011/projects/ui.cp-3cd94f75.js:20041:29)

However, executing the line in ui.cp.js works just fine.

To Reproduce
Steps to reproduce the behavior. Please make sure to let us know if your problem requires the loading of custom components,...

Screenshots
If applicable, add screenshots to help explain your problem.

Setup
Please delete non-applicable items!

  • Windows
  • Linux

Version: Please paste the lively.next commit on which the problem occurred here (use the copy button of the Version Checker in the bottom left corner).
6da99ba

@rickmcgeer rickmcgeer added the 🐞 bug Something isn't working label Mar 4, 2025
@merryman
Copy link
Member

merryman commented Mar 4, 2025

I cant see how this is a bug. Where in the imports do you see GalyleoDashboardStudio?

import { part, config } from 'lively.morphic';
import { LivelyWorld } from 'lively.ide/world.js';
import { GalyleoStudioWorld } from './ui.cp.js';

Its nowhere hence the evaluation fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants