emulsify-ds / emulsify-drupal

Drupal theme built with Storybook and Webpack
GNU General Public License v2.0
91 stars 42 forks source link

a.getElementById is not a function #224

Closed rpayanm closed 2 years ago

rpayanm commented 2 years ago

emulsify version: v3.0.2

Problem description: I followed these instructions: https://docs.emulsify.info/usage/hot-reload-drupal

When I run npm run develop everything goes fine but I get this error on the JS console (I'm logged as admin(1)):

Uncaught TypeError: a.getElementById is not a function
    attach main-menu.js:3
    attachBehaviors drupal.js:27
    attachBehaviors drupal.js:24
    insert ajax.js:569
    jQuery 2
    insert ajax.js:567
    success ajax.js:446
    success ajax.js:444
    bigPipeProcessPlaceholderReplacement big_pipe.js:37
    jQuery 2
    bigPipeProcessDocument big_pipe.js:50
    <anonymous> big_pipe.js:77
    jQuery 8
    <anonymous> big_pipe.js:72
    <anonymous> big_pipe.js:79

If I open a private window I cannot see that error.

ModulesUnraveled commented 2 years ago

Hey @rpayanm, We don't "officially" support hot reloading in Drupal. Our process is to do theme development in the Storybook interface (where the hot-reloading type of development is supported) and then just wire the component up to Drupal. In fact, I rarely have a Drupal site running locally while I'm doing the frontend development.

The docs you referenced were provided by a community member originally a year ago or so. So, maybe it worked with v2.x?

If you find a solution to your issue, a PR to update the docs would be awesome!

For now, I'm going to close this issue since it's not something we generally recommend, or a workflow we use.

Feel free to re-open if you have more details, or something. :+1: