Skip to main content
related Drupal Answers question
Source Link
therobyouknow
  • 2.4k
  • 3
  • 32
  • 60

I've added

dependencies:
 - core/jquery
 - core/drupal

to mymodule.info.yml

(where mymodule is my module name).

How do I ensure Drupal "sees" these new dependencies?

For example, can I clear the cache, drush cr ?

Or is there another drush command to run or something else to do?

When does Drupal read the info.yml file? When module enabled - yes - but what other times?

I would prefer a command to get it to read that file rather than uninstall my module and reenable my module as this could be inconvenient with regard to config/content needing to be re-setup.

Thank you.

Background

I'm working on solving a problem where anonymous users see Uncaught ReferenceError: Drupal is not defined in console, based on a solution that adds the dependencies I mentioned above: Anonymous Users See Uncaught ReferenceError: Drupal is not defined In console.

Potentially related: jQuery not Loading for “Anonymous” Users

I've added

dependencies:
 - core/jquery
 - core/drupal

to mymodule.info.yml

(where mymodule is my module name).

How do I ensure Drupal "sees" these new dependencies?

For example, can I clear the cache, drush cr ?

Or is there another drush command to run or something else to do?

When does Drupal read the info.yml file? When module enabled - yes - but what other times?

I would prefer a command to get it to read that file rather than uninstall my module and reenable my module as this could be inconvenient with regard to config/content needing to be re-setup.

Thank you.

Background

I'm working on solving a problem where anonymous users see Uncaught ReferenceError: Drupal is not defined in console, based on a solution that adds the dependencies I mentioned above: Anonymous Users See Uncaught ReferenceError: Drupal is not defined In console.

I've added

dependencies:
 - core/jquery
 - core/drupal

to mymodule.info.yml

(where mymodule is my module name).

How do I ensure Drupal "sees" these new dependencies?

For example, can I clear the cache, drush cr ?

Or is there another drush command to run or something else to do?

When does Drupal read the info.yml file? When module enabled - yes - but what other times?

I would prefer a command to get it to read that file rather than uninstall my module and reenable my module as this could be inconvenient with regard to config/content needing to be re-setup.

Thank you.

Background

I'm working on solving a problem where anonymous users see Uncaught ReferenceError: Drupal is not defined in console, based on a solution that adds the dependencies I mentioned above: Anonymous Users See Uncaught ReferenceError: Drupal is not defined In console.

Potentially related: jQuery not Loading for “Anonymous” Users

edited title
Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

How todo I ensure Drupal recognises new dependencies added to the info.yml of an existing enabled module are picked up?

Source Link
therobyouknow
  • 2.4k
  • 3
  • 32
  • 60

How to ensure Drupal recognises new dependencies added to the info.yml of an existing enabled module

I've added

dependencies:
 - core/jquery
 - core/drupal

to mymodule.info.yml

(where mymodule is my module name).

How do I ensure Drupal "sees" these new dependencies?

For example, can I clear the cache, drush cr ?

Or is there another drush command to run or something else to do?

When does Drupal read the info.yml file? When module enabled - yes - but what other times?

I would prefer a command to get it to read that file rather than uninstall my module and reenable my module as this could be inconvenient with regard to config/content needing to be re-setup.

Thank you.

Background

I'm working on solving a problem where anonymous users see Uncaught ReferenceError: Drupal is not defined in console, based on a solution that adds the dependencies I mentioned above: Anonymous Users See Uncaught ReferenceError: Drupal is not defined In console.